Skip to content

Instantly share code, notes, and snippets.

View edwardgeorge's full-sized avatar
🍉

Edward George edwardgeorge

🍉
  • Manchester, UK
  • 23:43 (UTC +01:00)
View GitHub Profile
@edwardgeorge
edwardgeorge / cciphonethings_device.py
Created July 18, 2010 23:08
research into fake devices for syncing cultured code's Things task management application with other apps.
import gzip
import logging
import plistlib
import rfc822
import StringIO
class config:
DEVICE_NAME = "Fake iPod"
DEVICE_MODEL = "iPod touch"
CLIENT_API_VER = "1520"
@edwardgeorge
edwardgeorge / gist:396622
Created May 10, 2010 22:18
BREAKING the missing mercurial patch
--- mercurial/ui.py 2010-05-10 23:10:13.944672249 +0100
+++ mercurial/ui.py 2010-05-10 23:11:19.804626239 +0100
@@ -336,6 +336,11 @@
except EOFError:
raise util.Abort(_('response expected'))
def status(self, *msg):
+ try:
+ msg = list(msg)
+ msg[0] = 'BREAKING %s' % msg[0]
+ except IndexError, e:
@edwardgeorge
edwardgeorge / libdlna.patch
Created April 5, 2010 15:02
mac homebrew patches
diff -r d0965fd3703b configure
--- a/configure Mon Apr 05 15:52:33 2010 +0100
+++ b/configure Mon Apr 05 16:14:48 2010 +0100
@@ -610,9 +610,9 @@
fi
echolog "Checking for libavformat ..."
-check_lib ffmpeg/avformat.h av_register_all -lavformat || die "Error, can't find libavformat !"
+check_lib libavformat/avformat.h av_register_all -lavformat || die "Error, can't find libavformat !"
echolog "Checking for libavcodec ..."
@edwardgeorge
edwardgeorge / pbclient.py
Created February 4, 2010 18:05
os-x pastebin server and client. intended for sending text from a vm to the host computer's clipboard.
#!/usr/bin/env python
from __future__ import with_statement
import ConfigParser
import fileinput
import os
import socket
import sys
def get_config():
configfile = os.path.expanduser('~/.pbclient')
@edwardgeorge
edwardgeorge / syncgiststohg.py
Created January 8, 2010 21:53
sync gists to local hg repos
#!/usr/bin/env python
import os
import subprocess
import sys
import urlparse
from lxml import html
BASE_URL = 'http://gist.github.com/%s'
@edwardgeorge
edwardgeorge / unusedselectors.py
Created January 7, 2010 11:21
identify unused css selectors in a page, proof of concept
#!/usr/bin/env python
"""identify unused css selectors."""
from functools import partial
import re
import sys
import urlparse
import cssutils
from lxml import cssselect
from lxml import html
@edwardgeorge
edwardgeorge / followerdiff.py
Created January 6, 2010 21:34
show changes in twitter followers
#!/usr/bin/env python
"""Script to inform you of changes to your twitter followers.
ie: who just unfollowed you.
"""
from __future__ import with_statement
import bsddb
import contextlib
import functools
import pickle
@edwardgeorge
edwardgeorge / automasq.py
Created January 6, 2010 18:33
save dhcp provided dns servers to resolv.conf compatible file (OSX)
#!/usr/bin/env python
"""OSX-based script to watch for changes to network state and write out a
second resolv.conf file containing the DHCP provided nameservers, intended
for use with a local resolver such as dnsmasq. This is to workaround the
changes in Snow Leopard from Leopard with regards to DNS resolution.
ie: the inability to have both manually configured nameservers and
DHCP provided ones as well as the issues with split-DNS.
usage: python automasq.py /path/to/second/resolv.conf