This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
utils.each = function(arr, cb) { | |
for (var i = 0, len = arr.length; i < len; ++i) { | |
cb.length > 1 ? | |
cb(i, arr[i]) : | |
cb(arr[i]) | |
} | |
} |
(function(window,document,undefined) { | |
})(this,this.document); |
function slugify(text) { | |
text = text.replace(/[^-a-zA-Z0-9,&\s]+/ig, ''); | |
text = text.replace(/-/gi, "_"); | |
text = text.replace(/\s/gi, "-"); | |
return text; | |
} |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var app = require('../app'); | |
console.log(); | |
app.routes.all().forEach(function(route){ | |
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path); | |
}); | |
console.log(); | |
process.exit(); |
// Saved URL should look like this: | |
// javascript:<function> | |
// replace <function> with the following text | |
(function(){ | |
// Grab the username and password input fields | |
user = document.getElementById('txtUserName'); | |
pass = document.getElementById('txtPassword'); | |
// Grab the submit button, oddly named 'punch' |
alias web = 'python -m SimpleHTTPServer' |
This is handy for seeing the couchdb futon interface without making it publicly available. It still will only accept connections from localhost.
Syntax:
ssh -L <local port>:porxy:<remote port> <user>@<remote host>
Example for CouchDB:
ssh -L 5984:localhost:5984 [email protected]
var crypto = require('crypto') | |
, text = 'I love cupcakes' | |
, salt = 'abcdeg' | |
, hash | |
hash = crypto.createHmac('sha1', salt).update(text).digest('hex') |
> sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python | |
> sudo pip install Django | |
> git clone <project> | |
> cd <project> | |
> cp local_settings_test.py local_settings.py | |
> export DJANGO_SETTINGS_MODULE=qliqserver.settings | |
> mkdir logs | |
> pip install south | |
> pip install django-piston | |
> |