Skip to content

Instantly share code, notes, and snippets.

@tswicegood
tswicegood / gunicorn
Created November 21, 2014 17:03 — forked from hhuuggoo/gunicorn
import os
from os.path import join
from blaze.server import Server
from bambooclient import Client, autoload
def make_app():
basedir = os.environ.get('BAMBOO_BASEDIR', os.getcwd())
data_filename = os.environ.get('BAMBOO_DATAFILE', False)
#!/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:
@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

@tswicegood
tswicegood / dabr.md
Created November 3, 2011 19:50 — forked from rdmurphy/dabr.js
"Do a Barrel Roll!" Bookmarklet

Evasive Maneuvers

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