Skip to content

Instantly share code, notes, and snippets.

""" Place holder file so Django can load its tests.
Django assumes that every app that needs to be tested contains models,
so this class pacifies that's assumption by Django. We know that they
say about assumptions, however...
"""
dojo.provide('d51.data.TwitterReadStore');
dojo.require("dojo.data.util.simpleFetch");
dojo.require("dojo.io.script");
dojo.require('dijit._Widget');
dojo.require('dojox.encoding.base64');
dojo.declare('d51.data.TwitterReadStore',
[dijit._Widget], {
#!/bin/bash
set -e
toplevel_directory="$(git rev-parse --show-cdup)"
[ -n "$toplevel_directory" ] && { echo "please run from the toplevel directory"; exit 1; }
function call()
{
@tswicegood
tswicegood / sync_things.rb
Created October 1, 2009 20:13
Simple Ruby script to sync Basecamp and Things to-dos.
#!/usr/bin/env ruby
#
# Biggest problem with this is that it checks everything. Needs
# to be adjusted to only check N days and/or N tasks on Basecamp.
#
# Also has a problem in that Completed always wins. If you have a
# task marked at completed, then mark it as open again on just one
# side, it'll mark the other as completed if you run the sync again.
#
# All that said, it provides a basic, very rudimentary sync.
$ ping google.com
PING google.com (74.125.127.100): 56 data bytes
64 bytes from 74.125.127.100: icmp_seq=0 ttl=50 time=3126.577 ms
64 bytes from 74.125.127.100: icmp_seq=1 ttl=50 time=3276.712 ms
64 bytes from 74.125.127.100: icmp_seq=2 ttl=50 time=3433.196 ms
64 bytes from 74.125.127.100: icmp_seq=3 ttl=50 time=3402.663 ms
64 bytes from 74.125.127.100: icmp_seq=4 ttl=50 time=3355.678 ms
64 bytes from 74.125.127.100: icmp_seq=5 ttl=50 time=3587.272 ms
64 bytes from 74.125.127.100: icmp_seq=6 ttl=50 time=3547.825 ms
64 bytes from 74.125.127.100: icmp_seq=7 ttl=50 time=3506.732 ms
@tswicegood
tswicegood / gist:224502
Created November 2, 2009 21:55
Error I get when attempting to run bananajour
White-Rabbit:bananajour travis$ bananajour
* Started http://White-Rabbit.local:9331/
* Started git://White-Rabbit.local/
Registering http://White-Rabbit.local:9331/
Registering git://White-Rabbit.local/PHP-Extension-API.git
Registering git://White-Rabbit.local/activitystream.git
Registering git://White-Rabbit.local/argil.git
Registering git://White-Rabbit.local/bananajour.git
Registering git://White-Rabbit.local/bobby-tables.git
Registering git://White-Rabbit.local/d51.django.apps.schedules.git
#!/usr/bin/env python
import sys, os
def make_namespaced(path):
init_file = os.path.join(path, "__init__.py")
if os.path.exists(init_file):
return
open(init_file, "w").write("import pkg_resources\npkg_resources.declare_namespace(__name__)\n\n")
[make_namespaced(i[0]) for i in os.walk(sys.argv[1])]
@tswicegood
tswicegood / update_ted.py
Created November 8, 2009 17:18
simple script for grabbing HD versions of TED talks
#!/usr/bin/env python
import os
import feedparser
import pprint
import subprocess
TED_FEED = "http://feeds.feedburner.com/tedtalks_video"
def need_to_download(entries):
for entry in entries:
@tswicegood
tswicegood / twitterpack.js
Created November 29, 2009 23:33
Twitterpack
jetpack.future.import("pageMods");
var twitter_jetpack_callback = function(doc) {
// var doc = document; // uncomment to run directly in Firebug
$('body', doc).append($('<h1>jetpack!</h1>', doc));
var selector_text = 'a:contains("in reply to")';
var selector_for_more = '#pagination a';
@tswicegood
tswicegood / fix_ljworld.js
Created December 1, 2009 01:29
LJWorld/Lawrence.com Jetpack
jetpack.future.import("pageMods");
var fix_ljworld = function(doc) {
$('div[class$=ad]', doc).children().hide();
$('.ad', doc).children().hide();
$('.top-banner-ad', doc).css('height', '0');
};
var options = {};
options.matches = ["http://www2.ljworld.com/*",