Skip to content

Instantly share code, notes, and snippets.

@jacobian
jacobian / replication_fabfile.py
Created January 27, 2011 18:05
A fab task to start pg9 hot standby.
def start_replication():
"""
Begin Postgresql standby
"""
# Stop pg on the slave machine.
with settings(host_string=env.db_slave):
run('service postgresql-9.0 stop')
# Create the backup on the master machine
with settings(host_string=env.db_master):
@zyegfryed
zyegfryed / gist:814432
Created February 7, 2011 14:25
Tastypie OAuth
from oauth2 import Error
from django.utils.translation import ugettext as _
from tastypie.authentication import Authentication
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store, InvalidTokenError
@DavidYKay
DavidYKay / gist:912765
Created April 10, 2011 21:52
"Can Code Be Like Literature" - Jeremy Ashkenas
Jeremy
Absolutely brilliant
both technically
and oratorically
He wrote CoffeeScript
1st place 5k
21 min, 3 seconds
<7min mile
Big picture
@toastdriven
toastdriven / hackday1.txt
Created April 20, 2011 03:54
Mediaphormedia Hack Day #1
matt_c:
* Ellington Story & Section inlines
* Redis PubSub + Node + Whitelist = real-time activity on site
codysoyland:
* Gevent + 0MQ multi-test runner
fxdgear:
* More improvements on SocialBeer.me + Portal 2
@powdahound
powdahound / hipchat_bot.js
Created April 25, 2011 18:35
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
import re, sys
to_find = sys.argv[1]
def find_closing_paren(string, start):
current = start
num_open = 1
for c in string[start:]:
current += 1
@vmihailenco
vmihailenco / authentication.py
Created June 15, 2011 17:49 — forked from zyegfryed/gist:814432
Tastypie OAuth
import logging
from tastypie.authentication import Authentication
import oauth2
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store
from oauth_provider.store import Error as OAuthError
from oauth_provider.utils import get_oauth_request
from oauth_provider.utils import get_oauth_server
@michaelklishin
michaelklishin / build.sbt
Created July 4, 2011 13:32
An example SBT 0.10 build file that gets you BlueEyes on Scala 2.9
name := "theNextBigThing"
version := "0.1.0"
organization := "com.megacorp"
scalaVersion := "2.9.0-1"
scalacOptions ++= Seq("-deprecation", "-unchecked")
@dustin
dustin / templisten.go
Created July 18, 2011 00:42
Temperature -> CouchDB in go
package main
import (
couch "code.google.com/p/couch-go"
"encoding/json"
"flag"
"fmt"
"log"
"net"
"reflect"