Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $a=4; | |
print foo(),"\n"; | |
sub foo{my $a=$a;} | |
my @a=(10,5,1); | |
my @b=sort @a; | |
print "@b"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import Connection | |
import time | |
db = Connection().performance_test | |
db.drop_collection("updates") | |
collection = db.updates | |
collection.insert({"x": 1}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValueError at /changer5/cms/page/23/add-plugin/ | |
invalid literal for int() with base 10: 'null' | |
Request Method: POST | |
Request URL: http://localhost:8000/changer5/cms/page/23/add-plugin/ | |
Django Version: 1.4.5 | |
Python Executable: /Users/vinit/.virtualenvs/spiegelogie/bin/python | |
Python Version: 2.7.3 | |
Python Path: ['/Users/vinit/Code/work/spiegelogie', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg', '/Users/vinit/.virtualenvs/spiegelogie/lib/python27.zip', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-darwin', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-mac', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/lib-tk', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/lib-old', '/Users/vinit/.virtualenvs/spiegelogi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ValueError at /changer5/cms/page/23/add-plugin/ | |
invalid literal for int() with base 10: 'null' | |
Request Method: POST | |
Request URL: http://localhost:8000/changer5/cms/page/23/add-plugin/ | |
Django Version: 1.4.5 | |
Python Executable: /Users/vinit/.virtualenvs/spiegelogie/bin/python | |
Python Version: 2.7.3 | |
Python Path: ['/Users/vinit/Code/work/spiegelogie', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg', '/Users/vinit/.virtualenvs/spiegelogie/lib/python27.zip', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-darwin', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-mac', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/lib-tk', '/Users/vinit/.virtualenvs/spiegelogie/lib/python2.7/lib-old', '/Users/vinit/.virtualenvs/spiegelogi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shortcut to this dotfiles path is $ZSH | |
export ZSH=$HOME/.dotfiles | |
# your project folder that we can `c [tab]` to | |
export PROJECTS=~/projects | |
#Aliases | |
alias c='clear' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// attempts to normalize transition strategies across browsers | |
// css3 transitions vs. $.animate | |
;(function() { | |
// http://stackoverflow.com/questions/5023514/how-do-i-normalize-css3-transition-functions-across-browsers | |
var VENDOR_TRANSITION_END = (function() { | |
var el = document.createElement('fakeelement'); | |
var transitions = { | |
'transition': 'transitionend', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// attempts to normalize offset (x,y) strategies across browsers | |
// translate3d, translate or left/top | |
;(function() { | |
// http://stackoverflow.com/questions/5661671/detecting-transform-translate3d-support | |
var VENDOR_TRANSFORM = (function() { | |
var el = document.createElement('p'), | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
// 'msTransform':'-ms-transform', // not using that because you don't have transitions ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Render view helper | |
// if the request is coming from mobile and if you have a view | |
// with users.mobile.jade, then that view will be rendered | |
app.use(function (req, res, next) { | |
res._render = res.render | |
res.render = function (template, locals, cb) { | |
var ua = req.header('user-agent') | |
var fs = require('fs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Optimizations and tasks running for production | |
# pre-commit hook to run grunt tasks everytime a less and js file is changed | |
lessFile="socialchools/static/css/styles.less" | |
cssFile = "${lessFile/.less/.css}" | |
jsFile = "socialschools/static/js/socialschools.min.js" |