Skip to content

Instantly share code, notes, and snippets.

View gtzilla's full-sized avatar
🎯
Focusing

gregory tomlinson gtzilla

🎯
Focusing
View GitHub Profile
javascript:(function(){setInterval(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;%20i<a.length;%20i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href){var%20h=s.href.replace(/(&|\?)forceReload\=\d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}},3000)})()
import pylibmc
import Queue
import logging
import functools
"""
This is a transparent pool library that wraps a pylibmc client
from MemcachePool import mc
mc.get(key)
#!/usr/bin/env python
### Requires latest boto (cuz I checked in code to boto a moment ago)
import uuid
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import Question, QuestionForm, QuestionContent
from boto.mturk.question import AnswerSpecification, FreeTextAnswer
from boto.mturk.question import Overview
#from boto.mturk.qualification import Qualifications # these exist!
var partial = exports.partial = function partial(fn) {
var args = arguments,
func = fn;
[].shift.apply(args);
return function() {
var _args = args;
[].push.apply(_args, arguments);
return func.apply(func, _args);
};
};
#!/usr/bin/env python
"""
Add php-serve.py to your PATH, then, from whatever directory is the root
of your PHP application, just run:
$ php-serve.py
You can optionally specify a port number as an argument. By default,
port 8000 is used:
@gtzilla
gtzilla / gist:1247115
Created September 28, 2011 06:10 — forked from j2labs/gist:1247091
> function foo(x,y) {
if(arguments.length > 2) throw new Error("Stupid no method overloading lameness error");
... args = Array.prototype.join.call(arguments, ",");
... console.log('X:' + x + ' Y:' + y + ' Args:' + args)
... }
> foo(1,2)
X:1 Y:2 Args:1,2
> foo(1,2,3,4,5)
X:1 Y:2 Args:1,2,3,4,5
@gtzilla
gtzilla / arity_check.js
Created September 28, 2011 07:55 — forked from j2labs/arity_check.js
Node.js friendly form of the arity checking decorator for javascript
exports.arity_decorator = function(fun) {
function wrapped() {
if(arguments.length != fun.length)
throw new Error("Y U NO USE RIGHT?!")
fun.apply(this, arguments)
}
return wrapped;
}

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@gtzilla
gtzilla / Vagrantfile
Created October 15, 2019 20:07 — forked from gabrielelana/Vagrantfile
How to create a VirtualBox machine with encrypted storage with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps