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
#!/usr/bin/env python | |
import sys, tty, termios | |
fd = sys.stdin.fileno() | |
old_settings = termios.tcgetattr(fd) | |
try: | |
filename = sys.argv[1] | |
f = open(filename, 'r') | |
text = f.read() |
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
@sans:"Droid Sans Book","Liberation Sans Regular","Arial Regular","DejaVu Sans Book"; | |
@sans_bold:"Droid Sans Bold","Liberation Sans Bold","Arial Bold","DejaVu Sans Bold"; | |
Map { | |
} | |
#world { | |
polygon-fill: #363636; | |
line-color: #ccc; | |
line-width: 0.5; |
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 os | |
import sys | |
import curses.ascii | |
import pickle | |
import pprint | |
import re | |
from optparse import OptionParser | |
class Page(object): | |
"""a page of contributions""" |
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 time | |
from textwrap import TextWrapper | |
import re | |
import tweepy | |
import urllib, urllib2 | |
swap_list = ["sausage", "house", "banana", "car", "computer"] | |
swap_list_re = '|'.join(swap_list) | |
swap_re = re.compile('(%s)' % swap_list_re, re.I) |
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
$(document).ready(function() { | |
var slider = null; | |
var sliderUl = null; | |
$('div.sliding').each(function() { | |
sliderUl = $('ul', this); | |
var productWidth = sliderUl.innerWidth() - $(this).outerWidth(); | |
slider = $('#slider').slider({ | |
animate: false, | |
min: 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
def json_callback(view_func): | |
"""if the GET parameter callback is set, wrap response in a function with that name""" | |
def _decorator(request, *args, **kwargs): | |
try: | |
# check for callback, if it's there, modify the return | |
callback = request.GET.__getitem__('callback') | |
response = view_func(request, *args, **kwargs) | |
response.content = callback + '(%s);' % response.content | |
return response | |
except KeyError, e: |
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.test import Client | |
from spec import Spec | |
from nose.tools import * | |
from spec.plugin import SkipTest | |
from wall.models import Wall, Card, Row, Column | |
from wall.factories import WallFactory, CardFactory, RowFactory, ColumnFactory | |
import json | |
class CardWallApplication(Spec): | |
def setup(self): |
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 sniffer.api import * # import the really small API | |
import os, termstyle, subprocess | |
# you can customize the pass/fail colors like this | |
pass_fg_color = termstyle.green | |
pass_bg_color = termstyle.bg_default | |
fail_fg_color = termstyle.red | |
fail_bg_color = termstyle.bg_default | |
# All lists in this variable will be under surveillance for changes. |
NewerOlder