Skip to content

Instantly share code, notes, and snippets.

def part1():
s = 'FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyreso
jiaaro /
Created Apr 15, 2011
Finds the largest duplicate text block in a file
#!/usr/bin/env python
import sys
orig_txt = open(sys.argv[-1], "r").readlines()
txt = [line.strip() for line in orig_txt]
match_len = 0
longest_match = [
'occurence1 start', 'occurance1 end',
jiaaro / gist:1098083
Created Jul 21, 2011 — forked from jacobian/gist:336445
Installing GeoDjango deps on Ubuntu 9.10
View gist:1098083
### Install some packages. Ignore the errors.
aptitude install binutils libgdal1-1.5.0 postgresql-8.3-postgis postgresql-server-dev-8.3 python-psycopg2 python-setuptools
### Make connecting to postgres easier
echo "local all all trust" > /etc/postgresql/8.3/main/pg_hba.conf
invoke-rc.d postgresql-8.3 reload
### Become the Postgres user to create a spatial template database:
jiaaro /
Created Sep 28, 2011
Check for radiohead tickets :(
#!/usr/bin/env python
I really *REALLY* wanted to see Radiohead at Roseland ballroom, but so
did everybody else and the tickets sold out in about 10 minutes. I didn't
get one :(
They haven't played in NYC in 3 years!
Here is a script that checks when tickets become available for an event.
View gist:1855582
Vowels all touch the top center and bottom except "O" which touches outlines
the center.
This is to give visual cues about the top and bottom of the line.
Consonants designed to be small and visually oriented around the center dot
for the most common letters, and as frequency of usage goes down, the dot
patterns that are oriented around the center dot are used.
# Note: This is the only file you *really* need. I've copied the contents
# of the important files that are part of our git repo for easier reading
# below :)
# I've prefixed this file with two dots to make it rise to the top of the
# gist. you can ignore those
jiaaro / defer
Created Jul 27, 2012
Automate life
View defer
#!/usr/bin/env python
sleep the specified amount of time
accepts seconds, minutes, hours, days, and years like so:
10 seconds: 10s
15 minutes: 15m
4 hours: 4h
90 days: 90d
jiaaro / rb_request_signing.php
Created Aug 14, 2012
Rootbuzz Request signing
View rb_request_signing.php
function apisig($salt, $dataDict) {
# sort the data by key
# url encode the data
$dataStr = http_build_query($dataDict);
# %20 is more robust than + for spaces
jiaaro /
Created Aug 24, 2012
Rootbuzz theming guide

Rootbuzz Theming Guide

  • Step 1: See the getting started video

  • Step 2: Do research on the theme you're matching

  • Look for elements that are consistent across many pages on the primary site

  • Look for a blog. Possible source of theme elements.

    What you're looking for is thematic elements such as:

    • what color the links should be
  • what should the sidebar look like

jiaaro /
Last active Dec 10, 2015
Magical, automatic super class caller in python (a terrible idea)
import inspect
def magicsuper(*args, **kwargs):
frame = inspect.currentframe().f_back
first_arg_name = frame.f_code.co_varnames[0]
self = frame.f_locals[first_arg_name]
super_klass = super(self.__class__, self)
return getattr(super_klass, frame.f_code.co_name)(*args, **kwargs)