Skip to content

Instantly share code, notes, and snippets.

@sambao21
sambao21 / gist:4063478
Created November 13, 2012 02:03
backly fontello icons
.icon-heart:before { content: '\2665'; } /* '♥' */
.icon-cog:before { content: '\2699'; } /* '⚙' */
.icon-edit:before { content: '\270d'; } /* '✍' */
.icon-comment:before { content: '\e718'; } /* '' */
.icon-left-open:before { content: '\e75d'; } /* '' */
.icon-right-open:before { content: '\e75e'; } /* '' */
.icon-left-open-big:before { content: '\e765'; } /* '' */
.icon-right-open-big:before { content: '\e766'; } /* '' */
.icon-facebook-rect:before { content: '\f301'; } /* '' */
.icon-twitter-bird:before { content: '\f303'; } /* '' */
@sambao21
sambao21 / gist:4006459
Created November 3, 2012 07:42
rename files for transfer to ipad
import os
upDir = '/Users/sambao21'
rootDir = '{0}/ipad_pics'.format(upDir)
y = 100
for dirName,subdirList,fileList in os.walk( rootDir ) :
print "Found directory:" , dirName
x = 0
for fname in fileList:
path = dirName + '/'
@sambao21
sambao21 / pip-cache-install.py
Created May 1, 2012 13:43 — forked from jacobian/pip-cache-install.py
Install a package from your local pip download cache without touching the 'net. (edit: will pip install normally if can't find in cache)
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.conf:
[install]
@sambao21
sambao21 / gist:2401117
Created April 16, 2012 20:01
virtualenvwrapper postmkvirtualenv
#!/bin/zsh
# This hook is run after a new virtualenv is activated.
echo "Do you want to install ipython & bpython?"
select yn in "Yes" "No"; do
case $yn in
Yes )
pip install ipython bpython;
easy_install readline;
break;;
No )
@sambao21
sambao21 / gist:994664
Created May 27, 2011 04:54
angry birds, king and 5 birds
(function () {
var RealXMLHttpRequest = XMLHttpRequest;
var FakeXMLHttpRequest = function () {
this._req = new RealXMLHttpRequest();
};
FakeXMLHttpRequest.prototype = {
abort: function () {
this._req.abort.apply(this._req, arguments);
},
getAllResponseHeaders: function () {
@sambao21
sambao21 / gist:987448
Created May 23, 2011 19:57
Get 3 stars on angrybirds
javascript: var i = 0; while (i<=69) {
localStorage.setItem('level_star_'+i,'3'); i++;
}
window.location.reload();