This file contains hidden or 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 import forms | |
| from tower import ugettext_lazy as _lazy | |
| class SettingForm(forms.Form): | |
| auto_watch_new_threads = forms.BooleanField( | |
| default=True, required=False, initial=True, | |
| help_text=_lazy('Automatically watch threads I create.')) | |
| auto_watch_reply = forms.BooleanField( |
This file contains hidden or 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
| [james ((c0ff882...)) kitsune]$ git lg -15 | |
| * c0ff882 - (HEAD, origin/master, origin/HEAD) Merge branch 'remove_long_filename' of github.com:readevalprint/kitsune into remove_long_filename (14 hours ago) <Tim Watt | |
| |\ | |
| | * f3837cb - (tim/remove_long_filename) removed (correct) gallery tests (14 hours ago) <Tim Watts :timw> | |
| | |\ | |
| | | * 5baa3a0 - removed gallery tests (15 hours ago) <Tim Watts :timw> | |
| | * | cd91d23 - removed (correct) gallery tests (14 hours ago) <Tim Watts :timw> | |
| | |/ | |
| | * 9619f86 - removed file and test (4 days ago) <Tim Watts :timw> | |
| * | 82c5e8c - Merge branch 'master' of github.com:jsocol/kitsune into remove_long_filename (14 hours ago) <Tim Watts :timw> |
This file contains hidden or 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
| if (!Date.now) { | |
| Date.now = function() { | |
| return (new Date()).getTime(); | |
| }; | |
| } | |
| var StatsD = (function($, undefined) { |
This file contains hidden or 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 | |
| """Command line script to convert a file, usually an image, into a data URI | |
| for use on the web.""" | |
| import base64 | |
| import mimetypes | |
| import os | |
| import sys | |
This file contains hidden or 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
| $ cat /home/james/bin/git-compare | |
| #!/bin/bash | |
| BRANCH=$(git here) | |
| echo "https://github.com/jsocol/kitsune/compare/$BRANCH" |
This file contains hidden or 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
| """ | |
| Improve PermissionDenied/HttpResponseForbidden handling in Django 1.2. | |
| At some point, Django added better handling for PermissionDenied | |
| and HttpResponseForbidden, including a handler403 on the ROOT_URLCONF, and, | |
| I think, the ability to fall back to a generic 403.html. | |
| But Django 1.2 didn't have that, as far as I know. So this middleware adds | |
| it for Django 1.2 projects. |
This file contains hidden or 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
| /** | |
| * Start by cloning git://github.com/technoweenie/twitter-node, then | |
| * save this file in the same directory as the clone, edit the login | |
| * information, and run it with: | |
| * | |
| * $ node twitter-fx4.js | |
| * | |
| * then sit back and watch! | |
| */ | |
| var twitter = require('./twitter-node/lib/twitter-node'), |
This file contains hidden or 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
| /** | |
| * storage.js - Simple namespaced browser storage. | |
| * | |
| * Creates a window.Storage function that gives you an easy API to access localStorage, | |
| * with fallback to cookie storage. Each Storage object is namespaced: | |
| * | |
| * var foo = Storage('foo'), bar = Storage('bar'); | |
| * foo.set('test', 'A'); bar.set('test', 'B'); | |
| * foo.get('test'); // 'A' | |
| * bar.remove('test'); |
This file contains hidden or 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
| /** | |
| * Usage: node sockolepsy.js <listen> <forward> <delay> | |
| * | |
| * Creates a generic TCP proxy that can introduce a controllable degree of | |
| * delay per packet. | |
| * | |
| * Params: | |
| * listen - the port to listen on. | |
| * forward - the port to foward to. | |
| * delay - the amount of delay to introduce, in ms. |
This file contains hidden or 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 functools import wraps | |
| class ContextDecorator(object): | |
| def __call__(self, fn): | |
| @wraps(fn) | |
| def decorator(*args, **kw): | |
| with self: | |
| return fn(*args, **kw) | |
| def __enter__(self): |