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
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/css application/x-javascript | |
</IfModule> |
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
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
grep = auto | |
[core] | |
excludesfile = /home/james/.gitignore | |
[alias] | |
a = add | |
ci = commit |
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
var partial = exports.partial = function partial(fn) { | |
var args = arguments, | |
func = fn; | |
[].shift.apply(args); | |
return function() { | |
var _args = [].slice.call(args, 0); | |
[].push.apply(_args, arguments); | |
return func.apply(func, _args); | |
}; | |
}; |
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
#!/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: |
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 functools import wraps | |
class ContextDecorator(object): | |
def __call__(self, fn): | |
@wraps(fn) | |
def decorator(*args, **kw): | |
with self: | |
return fn(*args, **kw) | |
def __enter__(self): |
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
/** | |
* Usage: node sockolepsy.js <listen> <forward> <delay> | |
* | |
* Creates a generic TCP proxy that can introduce a controllable degree of | |
* delay per packet. | |
* | |
* Params: | |
* listen - the port to listen on. | |
* forward - the port to foward to. | |
* delay - the amount of delay to introduce, in ms. |
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
/** | |
* storage.js - Simple namespaced browser storage. | |
* | |
* Creates a window.Storage function that gives you an easy API to access localStorage, | |
* with fallback to cookie storage. Each Storage object is namespaced: | |
* | |
* var foo = Storage('foo'), bar = Storage('bar'); | |
* foo.set('test', 'A'); bar.set('test', 'B'); | |
* foo.get('test'); // 'A' | |
* bar.remove('test'); |
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
/** | |
* Start by cloning git://github.com/technoweenie/twitter-node, then | |
* save this file in the same directory as the clone, edit the login | |
* information, and run it with: | |
* | |
* $ node twitter-fx4.js | |
* | |
* then sit back and watch! | |
*/ | |
var twitter = require('./twitter-node/lib/twitter-node'), |
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
""" | |
Improve PermissionDenied/HttpResponseForbidden handling in Django 1.2. | |
At some point, Django added better handling for PermissionDenied | |
and HttpResponseForbidden, including a handler403 on the ROOT_URLCONF, and, | |
I think, the ability to fall back to a generic 403.html. | |
But Django 1.2 didn't have that, as far as I know. So this middleware adds | |
it for Django 1.2 projects. |
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
$ cat /home/james/bin/git-compare | |
#!/bin/bash | |
BRANCH=$(git here) | |
echo "https://github.com/jsocol/kitsune/compare/$BRANCH" |