Skip to content

Instantly share code, notes, and snippets.

public function buildResource($league, $event_key, $test = false) {
App::import('Vendor', 'utility');
$utility = new Utility();
$this->league = $utility->getKey($league);
// Get the season key, which we can parse from the event_key
// i.e l.nba.com-2008-e-11099
$tmp = split('-', $event_key);
$this->season_key = $tmp[1];
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
# Current API.
exports.name: "Unit tests for ochre.Case"
exports.tests: {
"case has name property equal to what it is instantiated with": ->
testCase: ochre.Case "Some test", ->
assert.equal "Some test", testCase.name
# Hypothetical API.
import datetime
import gevent
from gevent import wsgi, pywsgi
# Configuration bits.
PORT = 8081
LOG_PATH = '/Users/daniellindsley/Desktop/LoggingFramework/benchmarks/receiver/logs/gevent_test.log'
# ============
<?php
// current implementation
class HairColor implements ReflectionAnnotation {
public $hairColor = "";
}
[HairColor(hairColor="purple")]
class PurplePeopleEater { }
class C(B):
def __init__(self, *args, **kwargs):
super(C, self).__init__(*args, **kwargs)
@tswicegood
tswicegood / diamond.py
Created May 13, 2011 21:49 — forked from markpasc/diamond.py
python diamond inheritance works
class A(object):
def say(self):
print "This is A"
class B(object):
def say(self):
print "This is B"
class C(A, B):
def say(self):
@tswicegood
tswicegood / dabr.md
Created November 3, 2011 19:50 — forked from rdmurphy/dabr.js
"Do a Barrel Roll!" Bookmarklet

Evasive Maneuvers

@tswicegood
tswicegood / README.md
Last active December 15, 2015 11:58 — forked from SeanJA/README.md

Set Up

You will need Sija's version of the garb gem, so add this line to your Gemfile (you will need git installed for this):

gem 'garb', :git => 'git://github.com/Sija/garb.git'

Then run the gem bundler: bundle install

Set your google username

#!/bin/bash
#
# Install Postgres 9.2, PostGIS and create PostGIS template on an Ubuntu 12.04 Server
# add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt)
# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg.
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg2.list
# Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc, update the package lists, and start installing packages: