Skip to content

Instantly share code, notes, and snippets.

@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/*",
/**
sleuth.js
@author Ross Bruniges
@version 0.9
A light-weight JavaScript based HTML/CSS/JS confirmation tool (NOT a validator)
Write tests in JSON (example found at - ????)
Call in page via sleuth.test_page.init(json_objs)
*/
var sleuth = window.sleuth || {};
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
jetpack.future.import("pageMods");
var become_a_hater = function(doc) {
var fan_button = $('.fan_action_frame .UIButton_Text', doc);
fan_button.html(fan_button.html().replace('Fan', 'Hater'));
};
var options = {};
options.matches = ["http://www.facebook.com/*"];
jetpack.pageMods.add(become_a_hater, options);
@tswicegood
tswicegood / fabfile.py
Created December 23, 2009 21:18
fabfile for generating a django app inside virtualenv using pip (requires tswicegood/fabric)
from fabric.api import env
import fabric.api
import fabric.contrib.files
import os, random, re
__all__ = ['local', 'init', ]
######
##
## Fabric callbacks
##
#!/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: