Category: Code

Regular Expression Twitter Linker

Regular expression to link twitter users… Replace this ‘@(\w+)’ With this ‘<a href=”\1″>@\1</a>’

Object Or Array Check in JavaScirpt

Test whether an object is an object or an array if(Object.prototype.toString.apply(arr) === ‘[object Array]’) alert(“Array”) Original Article

A Shell Scirpt to Mount ISO files

A Shell Scirpt to Mount ISO files – call it using the command ImageFile.iso. You need a folder called…

Delete Leading Whitespace

Delete leading whitespace (spaces/tabs/etc) from beginning of each line ruby -pe ‘gsub(/^\s+/, “”)’ < file.txt

Django server on custom Port

Running Django server on a custom Port python runserver 8001

Install LAMP Stack on Ubuntu/Debian

Install LAMP Stack on Ubuntu/Debian using apt-get sudo apt-get install openssh-server openssh-client apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi mysql-client mysql-common mysql-server…

Start a new Django Project

Command to start a new Django project… startproject [PROJECT_NAME] cd [PROJECT_NAME] python startapp [PROJECT_NAME]

Double space a file using Ruby

Double space a file with Ruby using the command ruby -pe ‘puts’ < file.txt

git push

Command to push the current repository in git to a online server git push

Sort by Line Length

Sort file by line length. Original Article… cat /etc/passwd | awk ‘{print length, 0}’ | sort -n | awk ‘{1=””;…