Skip to content

Instantly share code, notes, and snippets.

View jaychoo's full-sized avatar
☢️

Jay Choo jaychoo

☢️
  • New York, NY
View GitHub Profile
#if INTERACTIVE
#I @"C:\Tools\MongoDB-CSharp\MongoDB.Linq\bin\Debug"
#r "MongoDB.Driver.dll"
#r "MongoDB.Linq.dll"
#r "FSharp.PowerPack.Linq.dll"
#r "System.Core.dll"
#endif
open System
open MongoDB.Driver
#!/bin/bash
#http://gist.github.com/gists/315136
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
PARENT_JOB=pstat_master_unittest
KEY_PATH=$HOME/policystat/fabric/pstat_dev.key
PROJECT_ROOT=/var/www/pstattest.com/
DB_NAME=pstattest
@maxp
maxp / ebs-fabric.py
Created December 11, 2010 12:17
A Fabric script for striping EBS volumes
import commands
from fabric.api import *
# Globals
env.project='EBSSTRIPING'
env.user = 'myuser'
DEVICES = [
anonymous
anonymous / bootstrap.sh
Created June 2, 2011 17:19
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
@mattpodwysocki
mattpodwysocki / jsconf-eu-2011.md
Created October 1, 2011 13:40
JSConf.EU Slides
var http = require('http');
function fibonacci(n) {
if (n < 2)
return 1;
else
return fibonacci(n-2) + fibonacci(n-1);
}
http.createServer(function (req, res) {
import SocketServer
import SimpleHTTPServer
PORT = 1339
def fibonacci (n):
if n < 2:
return 1
else:
return fibonacci(n - 2) + fibonacci(n - 1)
@Gunio
Gunio / Simple Django URLs
Created October 18, 2011 20:02
Simple Django URLs
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('',
url(r'^(?P<input>[^/]+)$', 'UppercaseMaker.upper.views.home'),
)
@Gunio
Gunio / Django Relative Template Directory
Created October 18, 2011 19:25
Django Relative Template Directory
import os
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
)
@Gunio
Gunio / Simple Django View Response
Created October 18, 2011 19:11
Simple Django View Response
from django.shortcuts import render_to_response
def home(request, input="No input supplied"):
output = input.upper()
return render_to_response('home.html', {'output': output})