Skip to content

Instantly share code, notes, and snippets.

Avatar
Always shipping.

Dan Loewenherz dlo

Always shipping.
View GitHub Profile
@dlo
dlo / hosts
Created Nov 9, 2009
Pretty inclusive blacklist for /etc/hosts
View hosts
255.255.255.255 006.free-counter.co.uk
255.255.255.255 006.freecounters.co.uk
255.255.255.255 06272002-dbase.hitcountz.net # Web bugs in spam
255.255.255.255 09killspyware.com
255.255.255.255 0stats.com
255.255.255.255 1.adbrite.com
255.255.255.255 1.httpads.com
255.255.255.255 1.primaryads.com
255.255.255.255 102.112.2o7.net
255.255.255.255 102.122.2o7.net
@dlo
dlo / wsp.py
Created Nov 11, 2009
Shorthand for Go compilation.
View wsp.py
#!/usr/bin/env python
import sys
from os import system
prog = sys.argv[1]
pos = prog.find(".")
name = prog[:pos]
system("8g " + prog)
system("8l -o %s.out %s.8" % (name, name))
@dlo
dlo / README.md
Created Nov 18, 2009
A bare-bones tweet notifier for OS X.
View README.md

Growl Tweet Notifier

This gist has graduated into a real repository! Check it out at dlo/growltweet.

@dlo
dlo / textile.py
Created Nov 21, 2009
Textile 2.1.3
View textile.py
#!/usr/bin/env python
"""
PyTextile
A Humane Web Text Generator
"""
__version__ = '2.1.3'
__date__ = '2009/02/07'
@dlo
dlo / issue.py
Created Nov 24, 2009
git hook to push issues to github
View issue.py
#!/usr/bin/env python
"""
LICENSE
=======
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar
@dlo
dlo / to_binary.c
Created Dec 5, 2009
Converts ints to binary strings.
View to_binary.c
char *to_binary(int num) {
char s[9];
int i;
strcpy(s, "00000000");
for (i=0; i<8; i++) {
if (num & 01)
s[7-i] = '1';
num >>= 1;
}
return s;
@dlo
dlo / gitacular.py
Created Dec 7, 2009
A little online git viewer
View gitacular.py
#!/usr/bin/env python
from subprocess import *
import os
import re
import cgi
import cgitb
cgitb.enable()
GIT_DIR = "/Users/dloewenherz/gradifi/.git/"
View startup_plist.xml
Place this in /System/Library/LaunchAgents/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.PubSub.Agent</string>
<key>KeepAlive</key>
<false/>
@dlo
dlo / find.sh
Created Dec 20, 2009
Find files in current directory above 50mb
View find.sh
#!/bin/bash
find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
@dlo
dlo / updatecache.sh
Created Dec 20, 2009
Update shared cache in OS X
View updatecache.sh
#!/bin/bash
sudo update_dyld_shared_cache -force