Skip to content

Instantly share code, notes, and snippets.

View abhiomkar's full-sized avatar

Abhinay Omkar abhiomkar

View GitHub Profile
@abhiomkar
abhiomkar / sqlite_quick_ref.sql
Created January 13, 2012 11:52
SQLite Queries - Quick Reference
.
@abhiomkar
abhiomkar / cookies.js
Created November 14, 2011 10:02
JavaScript cookies - cookies.js
/**
* Read the JavaScript cookies tutorial at:
* http://www.netspade.com/articles/javascript/cookies.xml
*/
/**
* Sets a Cookie with the given name and value.
*
* name Name of the cookie
* value Value of the cookie
mkdir heroku-django
cd heroku-django
virtualenv --no-site-packages .
source bin/activate
bin/pip install django
@abhiomkar
abhiomkar / wget_urls.sh
Created August 29, 2011 11:43
Recursively Fetch all the possible URLs
wget -R.jpg,.jpeg,.gif,.png,.css,.js -c -r http://www.example.com/ -o urllog.txt
grep ' http' urllog.txt | awk '{print $3}'
@abhiomkar
abhiomkar / url_regex
Created July 11, 2011 14:39
Regex for URL Match
((http://)?|https://|ftp://|rtsp://|mms://|shttp://|tv://)([-\w\.]+)+(:\d+)?(/[^\s]+)?
@abhiomkar
abhiomkar / query_param_parse.js
Created July 7, 2011 17:43
URL Query Parameter Parser in Javascript
// Author: Abhinay Omkar
// Input: "red=123&green=456&blue=789"
// Output: [{key: 'red', value: 123}, {key: 'green', value: 456}, ...
var dict = [], i = 0; qparams.split('&').map(function(s) { dict[i] = {}; kv = s.split('='); dict[i].key = kv[0]; dict[i].value = kv[1]; i = i + 1; })
@abhiomkar
abhiomkar / git.sh
Created June 29, 2011 10:51
Git Cheat-sheet
## GIT Colors ON
git config color.branch auto
git config color.diff auto
git config color.interactive auto
git config color.status auto
## GIT Default Editor
git config --global core.editor vim
## Undo the Push (Revert the changes on Remote)
@abhiomkar
abhiomkar / rsync_copy.sh
Created June 25, 2011 18:17
Rsync - Copy files from remote server with Resume Feature
rsync --partial --progress --rsh=ssh user@hostname:/path/to/file /local/destination/path
@abhiomkar
abhiomkar / postgresl_hints.sql
Created June 24, 2011 20:19 — forked from luisuribe/Postgresl hints
Postgresql snippets
-- show tables
\dt
-- create a new database
# CREATE DATABASE mydb;
-- create user
# CREATE USER abhinay with password 'secret';
@abhiomkar
abhiomkar / wtf_code_quotations.txt
Created June 20, 2011 05:16
WTF Code Quotations
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." --Martin Golding
"Programming is like sex: one mistake and you’re providing support for a lifetime." --Michael Sinz
"The trouble with programmers is that you can never tell what a programmer is doing until it’s too late." --Seymour Cray
"Good code is its own best documentation." --Steve McConnell
"Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves." --Alan Kay