Skip to content

Instantly share code, notes, and snippets.

diff --git a/example/server.js b/example/server.js
index 167fc43..db758a2 100644
--- a/example/server.js
+++ b/example/server.js
@@ -61,4 +61,16 @@ io.on('connection', function(client){
client.on('disconnect', function(){
client.broadcast({ announcement: client.sessionId + ' disconnected' });
});
-});
\ No newline at end of file
@eykd
eykd / pycache.py
Created October 26, 2010 15:06
A simple script for caching packages on S3 and building simple HTML indices.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pycache -- cache a python package from PyPI on S3.
A simple script to collect a cache of packages locally and sync them up to an S3 bucket, using directories as namespaces so that different projects can have different dependencies.
This is just about the simplest thing that could possibly work.
"""
import warnings
warnings.filterwarnings('ignore')
@codysoyland
codysoyland / post-checkout
Created January 18, 2011 20:19
place in .git/hooks/post-checkout to delete empty directories and pyc files
#! /bin/sh
echo "Purging pyc files and empty directories..."
# Start from the repository root.
cd ./$(git rev-parse --show-cdup)
# Delete .pyc files and empty directories.
find . -name "*.pyc" -delete 2>&1 > /dev/null &
find . -type d -empty -delete 2>&1 > /dev/null &
@ptone
ptone / _webfaction_setup.rst
Created April 4, 2011 23:56
setting up a stack on webfaction

Setting up Webfaction for modern Django deployment

last updated: 4/5/2011

note that this stuff is always a moving target, much of this has been cribbed and combined from various blog posts. Much of the information was out of date from those, and if it is more than a couple months after the last updated date above, consider some of this likely to now be out of date.

@mcroydon
mcroydon / aprsbot.js
Created July 6, 2011 01:15
An IRC bot for looking up APRS checkins using node.js and node-irc.
var irc = require('irc');
var http = require('http');
var name = 'aprsbot';
var channel = '#avgeek';
var api_key = 'XXXXX';
var client = new irc.Client('irc.freenode.net', name, {channels: [channel]})
client.addListener('message', function(from, to, message) {
@epicserve
epicserve / sublime_text_2_notes.md
Created July 27, 2011 15:40
Notes on My Sublime Text 2 Setup

User File Settings

{
    "draw_indent_guides": false,
    "fold_buttons": true,
    "font_face": "Meslo LG S",
    "font_size": 13,
    "highlight_line": true,
    "ignored_packages": [],

"open_files_in_new_window": false,

@epicserve
epicserve / save_cookie_example.py
Created August 3, 2011 17:04
Example of how to save a cookie for logging into a website.
"""
Author: Jeff Triplett
Based off: https://code.djangoproject.com/wiki/PaginatorTag
Thanks to Brent O'Connor for pointing it out.
"""
from django import template
register = template.Library()
@jefftriplett
jefftriplett / pyhowl.py
Created September 20, 2011 05:36
Post to Howl (http://howlapp.com) from Python
"""
pyhowl - Post to Howl (http://howlapp.com)
Copyright (c) 2011, Jeff Triplett
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
@leah
leah / json-response.py
Created October 5, 2011 19:08
JSONResponse classes
import re
import simplejson
from django.http import HttpResponse
from django.conf import settings
class JSONResponse(HttpResponse):
def __init__(self, request, data):
indent = 2 if settings.DEBUG else None