Wednesday, February 18th, 2009
Here is a JavaScript function used to remove blank lines from a textarea. This snippet is using the Prototype JavaScript framework
function removeBlankLines(field)
{
$(field).value=$(field).value.gsub(/\s+/, '\r\n');
}
You can use it with "onblur" attribute:
Posted in HTML, JavaScript, Programming | No Comments »
Wednesday, August 13th, 2008
Here is a simple script to get the exchange rates from www.bnro.ro/nbrfxrates.xml
#!/bin/bash
# clear the screen
clear
# display an info message
echo "+------------------------------+"
echo "| BNR exchange |"
echo "+------------------------------+"
# check for parameters
if [ $# -ne 1 ]
then
echo "Usage: $0 eur ...
Posted in Linux, Programming | 2 Comments »
Thursday, November 15th, 2007
Here is a simple example of creating and running (executing) a shell script. This script will display the numbers from 1 to 10.
Creating the script:
With any text editor (Gedit for Gnome, Kate for KDE, nano):
#/bin/bash
for ((i = 1; i
Posted in Linux, Programming | 1 Comment »