Skip to content

Instantly share code, notes, and snippets.

Avatar

Mario Estrada marioestrada

View GitHub Profile
View gist:10319990
<script>
var ar = [1,2,3];
</script>
hi, i'm iframe
View pre-push.sh
#!/bin/sh
# 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
marioestrada / git branch
Created Feb 17, 2011
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
<?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*/
a:focus{
outline: none;
}
View 2204355
1. Go to http://www.google.com
2. type: 2204355
3. then 'I'm feeling lucky'
4. ENJOY
View .htaccess No-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
You can’t perform that action at this time.