- GitHub Staff
- @codysoyland
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
from django.template import Parser, Lexer, Token, Context, TextNode, TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, TOKEN_VAR | |
from django.conf import settings | |
LITERAL_DELIMITER = '8====D' | |
class LiteralNode(TextNode): | |
pass | |
def parse(parser): | |
depth = 0 |
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
/* | |
twirc.js | |
======== | |
Automating Twitter messages to IRC. BSD license. | |
Installation: | |
------------- | |
* brew install node |
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/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 & |
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 gevent | |
from gevent.server import StreamServer | |
from gevent.pool import Group | |
from gevent_zeromq import zmq | |
context = zmq.Context() | |
class CodependentGroup(Group): | |
""" | |
A greenlet group that will kill all greenlets if a single one dies. |
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
# Example usage: | |
# with temporary_settings(CELERY_ALWAYS_EAGER=True): | |
# run_task.delay() # runs task with eager setting enabled. | |
from contextlib import contextmanager | |
from django.conf import settings | |
@contextmanager | |
def temporary_settings(**temp_settings): | |
orig_settings = {} |
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
-module(riak_zmq). | |
-export([postcommit_publish/1, get_zmq_publisher/0, zmq_publisher/0, zmq_publisher/1]). | |
postcommit_publish(RObj) -> | |
Body = riak_object:get_value(RObj), | |
{ok, Pid} = get_zmq_publisher(), | |
Pid ! {send, Body}. | |
get_zmq_publisher() -> |
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/sh | |
echo $* | ssh gateway "cat > /tmp/fab-runner; chmod +x /tmp/fab-runner" | |
ssh gateway -t screen bash -init-file /tmp/fab-runner | |
# Usage: gateway.sh fab production deploy |
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 | |
# virtualenv-auto-activate.sh | |
# | |
# Installation: | |
# Add this line to your .bashrc or .bash-profile: | |
# | |
# source /path/to/virtualenv-auto-activate.sh | |
# | |
# Go to your project folder, run "virtualenv .venv", so your project folder | |
# has a .venv folder at the top level, next to your version control directory. |
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
from gevent.server import StreamServer | |
#import gevent | |
import time | |
class ClientDisconnected(Exception): | |
pass | |
class Handler(object): | |
def __init__(self, cache, socket, address): | |
self.cache = cache |
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
DJ Ango, yo! | |
http://railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7 | |
The Whistles | |
http://www.youtube.com/watch?v=ccgXjA2BLEY | |
Do it live! | |
http://www.youtube.com/watch?v=2tJjNVVwRCY | |
REMIX: http://www.youtube.com/watch?v=5j2YDq6FkVE&NR=1 |