Skip to content

Instantly share code, notes, and snippets.

/*
* Patch to make console.log, console.warn, etc work in IE8 & 9
*/
// Default list of functions for console.
var logFns = ["log", "info", "warn", "error", "assert", "dir", "clear", "profile", "profileEnd"];
// Define console.
if (typeof console == 'undefined') {
console = {};
@krusynth
krusynth / class.SanFranciscoBuilding.inc.php
Created May 29, 2014 20:12
State Decoded parser for San Francisco's building code for American Legal data
<?php
/**
* San Francisco parser for State Decoded.
* Extends AmericanLegal base classes.
*
* PHP version 5
*
* @license http://www.gnu.org/licenses/gpl.html GPL 3
* @version 0.8
@krusynth
krusynth / class.SanFranciscoCharter.inc.php
Created May 29, 2014 20:12
State Decoded parser for San Francisco's Charter for American Legal data
<?php
/**
* San Francisco parser for State Decoded.
* Extends AmericanLegal base classes.
*
* PHP version 5
*
* @license http://www.gnu.org/licenses/gpl.html GPL 3
* @version 0.8
@krusynth
krusynth / class.SanFrancisco.inc.php
Created May 29, 2014 20:11
State Decoded parser for San Francisco for American Legal data
<?php
/**
* San Francisco parser for State Decoded.
* Extends AmericanLegal base classes.
*
* PHP version 5
*
* @license http://www.gnu.org/licenses/gpl.html GPL 3
* @version 0.8
@krusynth
krusynth / class.Philadelphia.inc.php
Created May 29, 2014 20:09
State Decoded parser for Philadelphia for American Legal data
<?php
/**
* San Francisco parser for State Decoded.
* Extends AmericanLegal base classes.
*
* PHP version 5
*
* @license http://www.gnu.org/licenses/gpl.html GPL 3
* @version 0.8
@krusynth
krusynth / class.Chicago.inc.php
Last active August 29, 2015 14:01
State Decoded parser for Chicago for American Legal data
<?php
/**
* San Francisco parser for State Decoded.
* Extends AmericanLegal base classes.
*
* PHP version 5
*
* @license http://www.gnu.org/licenses/gpl.html GPL 3
* @version 0.8
<?php
// TODO: Implement RecursiveIterator
class NodeBranch
{
private $_content;
private $_children = array();
private $_parent;
@krusynth
krusynth / pyrax_content_disposition.py
Created April 1, 2014 20:35
Example of sending custom headers using Pyrax.
import config
import time
import uuid
import os
import pyrax
pyrax.set_setting("identity_type", "rackspace")
pyrax.set_setting("region", config.rackspace['API_REGION'])
@krusynth
krusynth / commits.py
Created March 20, 2014 15:09
Get most recent commit for every repo the user has access to.
from github import Github
from datetime import datetime
g = Github("user", "pass")
since = datetime(2014, 1, 1)
for org in g.get_user().get_orgs():
print org.name
@krusynth
krusynth / governmentify.sh
Created March 8, 2014 19:27
Uses ImageMagick to read in a text file, transform it into an image, rotate it, add noise, and output as a pdf.
cat ./1-219.1.txt | convert \
-font Courier \
text:- \
-rotate `convert null: -format '%[fx:rand()*15-7]' info:` \
-attenuate 0.1247 +noise Gaussian \
-colorspace Gray \
1-219.1.pdf