Evasive Maneuvers
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
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]; | |
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
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 |
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
# 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. |
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
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' | |
# ============ |
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
<?php | |
// current implementation | |
class HairColor implements ReflectionAnnotation { | |
public $hairColor = ""; | |
} | |
[HairColor(hairColor="purple")] | |
class PurplePeopleEater { } |
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
class C(B): | |
def __init__(self, *args, **kwargs): | |
super(C, self).__init__(*args, **kwargs) |
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
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): |
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
#!/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: |
OlderNewer