Skip to content

Instantly share code, notes, and snippets.

View wizardishungry's full-sized avatar
🐫
Copyright 1987-2013, Larry Wall

Jon Williams wizardishungry

🐫
Copyright 1987-2013, Larry Wall
View GitHub Profile
@wizardishungry
wizardishungry / export_address_book.applescript
Created April 22, 2009 18:40
Exports all current address book contacts as individual VCards; suitable for storing in Git :)
tell application "Address Book"
tell application "Finder" to get folder of (path to me) as Unicode text
set PathName to result
--
set npersons to count of people
repeat with i from 1 to npersons
set vcardinfo to (vcard of person i) as text
set personName to (name of person i) as text
set target_file to PathName & personName & ".vcf" as text
try
@wizardishungry
wizardishungry / .gitattributes
Created April 13, 2009 21:47
Apple's .plist files have two equivalent on-disk representations, binary and xml. These snippets help keep binary crap out of your repository.
*.plist filter=xmlplist
# surprise! Quartz patches are plists, too!
*.qtz filter=xmlplist
# How do I get the first "echo" to output a tab character? Using ^V in bash to get a literal control character.
find Music/{iTunes/iTunes\ Music,Mp3\ Dump} -type f -exec echo -n {} " " \; -exec md5 -q {} \; >> music-md5sums.txt
@wizardishungry
wizardishungry / fixtures.yml
Created March 31, 2009 19:18
Symfony on OpenBSD 4.4 seems to be having problems making fixtures work
Setting:
password:
key: password
vendor: <?php echo trackerUser::crypt('LimeTracker'),"\n"; ?>
intent:
key: intent
vendor: false
#!/bin/sh
user='WIZARDISHUNGRY'
password='youdidntreallythinksodidyou'
path=~/path/to/data/delicious.xml
cd `dirname $path`
curl --user $user:$password -fsS -o $path 'https://api.del.icio.us/v1/posts/all'
git add $path
git commit -m 'automated delicious backup' > /dev/null
#!/bin/sh
# foreach argument runs git pull
for arg in $@; do
cd $arg &&
if [ -d ".git" ] ; then
/bin/echo -n "$arg: "
BRANCH=`git branch --no-color 2> /dev/null | sed -e 's/* \(.*\)/\1/'`
if [ "$BRANCH" == "master" ] ; then
git pull
@wizardishungry
wizardishungry / limetracker-assert.php
Created March 12, 2009 16:23
shared webhost sanity check for sflimetracker
<?php
/**
This continually evolving script can be dropped into a LimeTracker install and used to diagnose problems.
**/
if(isset($_GET['phpinfo'])) { phpinfo(); exit(); }
function assert_callcack($file, $line, $message) {
echo "assert failed: <code>$message</code><br>\n";
}
@wizardishungry
wizardishungry / databases.yml
Created January 28, 2009 17:14
sflimetracker databases.yml modified to use mysql
all:
propel:
class: sfPropelDatabase
param:
encoding: binary
persistent: true
# mysql
param:
dsn: mysql://user:password@localhost/limetracker
@wizardishungry
wizardishungry / x-mixed-replace.php
Created January 22, 2009 19:26
Server push solution
<?php
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
function hardFlush() {
flush();
ob_flush();
}
header('Content-type: multipart/x-mixed-replace;boundary="rn9012"');
for($i=0;$i<=10;$i++)
@wizardishungry
wizardishungry / my-macports.sh
Created January 8, 2009 03:59
I should probably keep this utd
port install apache2 +darwin_9
port install apr
port install apr-util
port install autoconf
port install autoconf213
port install automake
port install bash-completion
port install bitchx
port install bzip2
port install cclient