I hereby claim:
- I am geekfish on github.
- I am eleni (https://keybase.io/eleni) on keybase.
- I have a public key is ASAWPKZENy4gxWlP7B4wwYiqdWNfI6lSZ92flOx2Yk9Niwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
# Usage: `twig commit "<your message>"` | |
git commit -m "$* | |
Fixes: [`twig jira`](https://tictrac.atlassian.net/browse/`twig jira`)" |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
import json, pyperclip, pprint | |
json_content = json.loads(pyperclip.paste()) | |
pprint.pprint(json_content) | |
pyperclip.copy(pprint.pformat(json_content)) |
""" | |
This is to allow grabing a random set of rows, | |
in a repeatable way (for example, if you need to ensure that | |
a user always sees the same "random" set of results). | |
Method one sets the seed in Postgres. | |
It's using order by RANDOM(), so it can be extremely slow | |
for large querysets. | |
Method two is significantly faster, as we are generating |
from django.template import VariableNode | |
from django.template.loader_tags import ExtendsNode | |
def _get_template_variables(template): | |
""" | |
Extracts all the variable node tokens of the given template. | |
This gets worked out recursively by extracting nodes from possible | |
parent templates via the extension nodes. | |
""" |
class MyTestCase(TestCase): | |
urls = 'my_app.urls' # This is the default urls module | |
def setUp(self): | |
the_monkey_patching() | |
def tearDown(self): | |
the_cleanup() |
import string | |
' or '.join((', '.join(string.lowercase[:-1]), string.lowercase[-1])) |
#!/bin/bash | |
echo "This script will rebuild a Debian style package (deb) of latest stable" | |
echo "Nginx. The original deb is from nginx.org apt repository." | |
echo | |
echo "This will prompt you yes or no on a few changes to the build as well as" | |
echo "it will compile and package the latest Google NGX Pagespeed module." | |
echo | |
echo "This is built and tested on Ubuntu 12.04 LTS, fresh OS install." | |
echo "There are no guarantees, and I take no liability if it breaks, but it" |
#!/usr/bin/perl | |
# PostgreSQL Tunnel Tool for Mac OS X and Linux | |
# Copyright (c) 2010 Linode, LLC | |
# Author: Philip C. Paradis <pparadis@linode.com> | |
# Usage: postgresql-tunnel.pl [start|stop] | |
# Access a PostgreSQL database server via an SSH tunnel. | |
$local_ip = "127.0.0.1"; | |
$local_port = "5433"; |