Skip to content

Instantly share code, notes, and snippets.


Mario Estrada marioestrada

View GitHub Profile
View gist:10319990
var ar = [1,2,3];
hi, i'm iframe
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
marioestrada / git branch
Created February 17, 2011 14:35
Shows the current working branch on the prompt with the corresponding revision control software (Mercurial or Git).
View git branch
# Modify prompt
function bash_git_branch
git branch 2> /dev/null | grep \* | python -c "print '[git:'+raw_input()[2:]+']'" 2> /dev/null
function bash_hg_branch
hg branch 2> /dev/null | python -c "print '[hg:' + raw_input()[0:] + ']'" 2> /dev/null
# PS1 = "\h:\W \u\$ "
View email regex.php
regex = '/^[\w!#$%&\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/iD';
View Fix CSS browser quirks.css
/*remove the webkit orange/light-blue border around text-inputs and textareas */
input:focus, textarea:focus{
outline: none;
/*remove the ugly dotted borders around links in firefox*/
outline: none;
View 2204355
1. Go to
2. type: 2204355
3. then 'I'm feeling lucky'
View .htaccess No-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]