Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pydftk
# Copyright 2009 W. Kyle White
# Rewrite of stapler; Copyright 2009 Philip Stark
# original stapler license is found in the file "LICENSE"
# if this file is missing, you can find a copy at
# http://stuff.codechaos.ch/stapler_license
# Features added:
// ==UserScript==
// @name gmail-wavplay
// @description Adds an embedded player within Gmail messsages containing audio files in the WAV format (e.g. Vonage voicemails).
// @author Evan Grim
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// ==/UserScript==
unsafeWindow.addEventListener('load', wavPlay, true);
@fwenzel
fwenzel / test_geoip.py
Created July 27, 2010 10:16
Test script for Bouncer GeoIP
#!/usr/bin/env python
import httplib
import urllib
from urlparse import urlparse
BOUNCER_URL = 'http://fwenzel.khan.mozilla.org/bouncer-tuxedo/'
PRODUCT = 'Firefox-3.6.8'
TEST_IP = '' # Use an IP from the region you want to test
@fwenzel
fwenzel / autol10n.sh
Created July 28, 2010 14:37
Auto-update locales kept in git from SVN.
#!/bin/bash
# Automatically pull L10n dirs from SVN, compile, then push to git.
# Runs on all project dirs named *-autol10n.
# Settings
GIT=`/usr/bin/which git`
FIND=`/usr/bin/which find`
DEVDIR=/home/fwenzel/dev
@fwenzel
fwenzel / auth.py
Created October 12, 2010 16:59
Monkey-patching stronger hash support into Django
"""
from future import django_sha256_support
Monkey-patch SHA-256 support into Django's auth system. If Django ticket #5600
ever gets fixed, this can be removed.
"""
import hashlib
import random
import os
@fwenzel
fwenzel / lion-virtualenv.sh
Created July 21, 2011 17:42
Recreating virtualenvs after upgrading to OS X Lion.
# Upgrade to OS X Lion, notice your virtualenvs are all hosed.
# Install Xcode 4.1 from the app store (or //fs2/IT/Apple/).
# Make sure to actually *run* the install, it's an app inside Applications. Throw it away afterwards, if you want the space back.
sudo easy_install pip
sudo pip install virtualenv virtualenvwrapper ipython
# blow the old one(s) away
rmvirtualenv playdoh
@fwenzel
fwenzel / Tectonicus_config.xml
Created September 10, 2011 20:34
Some useful scripts for Minecraft servers: run server, and create server map with Tectonicus.
<tectonicus version="2">
<config
mode = "cmd"
outputDir = './output'
>
<!-- general config options go here -->
</config>
@fwenzel
fwenzel / minecraft_64bitify.sh
Created March 18, 2012 21:32
Switch out Minecraft's Java Application Stub on OSX Lion and force 64bit mode.
#!/bin/sh
# Thank you, StackExchange: http://gaming.stackexchange.com/questions/44822/64-bit-java-not-recognized-in-minecraft
gzip /Applications/Minecraft.app/Contents/MacOS/JavaApplicationStub # save a backup
cp /System/Library/Frameworks/JavaVM.framework/Versions/Current/Resources/MacOS/JavaApplicationStub /Applications/Minecraft.app/Contents/MacOS/
/usr/libexec/PlistBuddy -c "Add :Java:JVMArchs:0 string 'x86_64'" /Applications/Minecraft.app/Contents/Info.plist
@fwenzel
fwenzel / video.html
Created March 20, 2012 16:45
An example video tag, first webm, then ogv, then mp4.
<video id="movie" width="640" height="360" preload="none" controls poster="http://blog.mozilla.com/webdev/files/2011/07/mozilla_wht.png">
<source src="http://videos-cdn.mozilla.net/serv/flux/playdoh/playdoh-overview.webm" type='video/webm; codecs="vp8, vorbis"' />
<source src="http://videos-cdn.mozilla.netserv/flux/playdoh/playdoh-overview.theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
<source src="http://videos-cdn.mozilla.net/serv/flux/playdoh/playdoh-overview.mp4" />
<p>Download video as <a href="http://videos-cdn.mozilla.net/serv/flux/playdoh/playdoh-overview.mp4">MP4</a>, <a href="http://videos-cdn.mozilla.net/serv/flux/playdoh/playdoh-overview.webm">WebM</a>, or <a href="http://videos-cdn.mozilla.net/serv/flux/playdoh/playdoh-overview.theora.ogv">Ogg</a>.</p>
</video>
@fwenzel
fwenzel / toolbar-button.js
Created March 31, 2012 22:41
A way to add a Firefox toolbar button with the addons SDK
/** Hat tip to <http://stackoverflow.com/questions/5572632/> */
var data = require("self").data;
var {Cc, Ci} = require("chrome");
var mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator);
/**
* Add a toolbar button to the main nav bar.
*
* options you may want to set: