Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / meeting.py
Created October 20, 2009 18:20 — forked from jbalogh/meeting.py
Spit out an almost random order for the Mozilla webdev meeting
from datetime import datetime
import random
from pyquery import PyQuery
URL = ('https://wiki.mozilla.org/Webdev:Meetings:%s-%s-%s' %
datetime.now().timetuple()[:3])
names = PyQuery(url=URL)('h2 .mw-headline').text().split()
@fwenzel
fwenzel / postactivate
Created November 14, 2009 00:46
virtualenvwrapper scripts
#!/bin/bash
site_packages=$(virtualenvwrapper_get_site_packages_dir)
PROJECT=`basename $VIRTUAL_ENV`
DIR="$HOME/dev/$PROJECT"
if [ -d $DIR ]; then
cd $DIR
fi
@fwenzel
fwenzel / new-addon.py
Created December 11, 2009 21:54 — forked from jbalogh/new-addon.py
Create a new, random add-on through the AMO add-on builder
import httplib
import urllib
import uuid
ROOT = 'addons.mozilla.org'
BUILDER_URL = '/en-US/developers/tools/builder/'
params_ = {
'name': 'unst unst',
@fwenzel
fwenzel / cleanup-maildir.py
Created January 19, 2010 12:13
A script for cleaning up mails in Maildir folders
#!/usr/bin/python -tt
"""
USAGE
cleanup-maildir [OPTION].. COMMAND FOLDERNAME..
DESCRIPTION
Cleans up old messages in FOLDERNAME; the exact action taken
depends on COMMAND. (See next section.)
Note that FOLDERNAME is a name such as 'Drafts', and the
@fwenzel
fwenzel / Things-Bugzilla.applescript
Created January 20, 2010 22:47
Takes a bugzilla.mozilla.org bug number from the user and adds a new Things.app ToDo item for it in the Inbox.
(*
Things-Bugzilla AppleScript:
Takes a bugzilla.mozilla.org bug number from the user, and adds a new
Things.app ToDo item for it in the Inbox.
*)
-- get the bug number from the user
set bugnumber to ""
set clip to (the clipboard as string)
repeat with i in characters of clip
@fwenzel
fwenzel / django-servers.sh
Created January 25, 2010 09:56
A Debian init script to run one or more FCGI-based Django applications.
#! /bin/sh
### BEGIN INIT INFO
# Provides: FastCGI servers for Django
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Start FastCGI servers with Django.
# Description: Django, in order to operate with FastCGI, must be started
# in a very specific way with manage.py. This must be done
@fwenzel
fwenzel / git-svn-submodules.md
Created February 12, 2010 19:48
Clone SVN repo into git

Clone SVN into a git repo:

  • git svn clone https://svn.mozilla.org/my/project project
  • cd project
  • git remote add origin git@github.com:/johndoe/project
  • git push origin master

Change a file:

  • touch abc; git add abc; git commit -m 'awesome file'
from django.core.serializers import serialize
serialize('json', [list, of, objects], indent=4)
@fwenzel
fwenzel / slim.sh
Created March 8, 2010 15:46 — forked from jbalogh/slim.sh
Make a small AMO database.
#!/bin/sh
DATE=$(date +%Y-%m-%d)
DIR="$(pwd)/amo-slim-$DATE"
rm -rf $DIR
mkdir -p $DIR
cd $DIR
DB='remora'
// ==UserScript==
// @name expertsExchange
// @namespace smk
// @description kill the stupid hiding mechanisms
// @include http://*.experts-exchange.com/*
// ==/UserScript==
var options={
warn_noanswers: true,
googleBotUserAgent: 'Googlebot/2.1 (+http://www.google.com/bot.html)',