Skip to content

Instantly share code, notes, and snippets.

View gdevanla's full-sized avatar

Guru Devanla gdevanla

View GitHub Profile
@gdevanla
gdevanla / gist:5521489
Created May 5, 2013 17:30
Command line to help filter stopwords.
tr -cs 'A-Za-z0-9' '\n' < allwords.txt | sort | uniq -c | sort -n
@gdevanla
gdevanla / gist:5444061
Created April 23, 2013 14:34
Replace text in file inline and create a backup up old file.
for i in `ls uc*`;do `sed -i .bckp -e '/textarea/,/textarea/!d' $i` ; done;
@gdevanla
gdevanla / gist:5443840
Last active December 16, 2015 13:48
Rename files with substring found in original file names.
for i in `ls`; do x=`echo $i | sed "s/doku.php.*s:uc\([1-9]*\).*/uc\1/g"`; mv $i $x.txt ; done;
#Command to list matching files in 2 folders.
find unittests -name *.java | xargs -L1 basename $1 | -xargs find ../../../Applications/iTrust/unittests/edu/ncsu/csc/itrust/ -name $1
@gdevanla
gdevanla / gist:3881485
Created October 12, 2012 20:59
Emacs Gems
Repeating commands
This package defines a command that repeats the preceding command, whatever that was, including its arguments, whatever they were. This command is connected to the key C-x z. To repeat the previous command once, type C-x z. To repeat it a second time immediately after, type just z. By typing z again and again, you can repeat the command over and over.
http://stackoverflow.com/questions/6156286/emacs-lisp-call-function-with-prefix-argument-programmatically
Repeat Yank command
C-a C-k C-x ( C-y C-j C-x ) C-u 9 C-x e
# use this code to run any django script with django environment
import settings
from django.core.management import setup_environ
setup_environ(settings)
http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/