Skip to content

Instantly share code, notes, and snippets.

@nathankerr
nathankerr / Info.plist
Last active September 28, 2024 00:41
Registering a Go app as a protocol handler under Mac OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>myapp</string>
<key>CFBundleIdentifier</key>
<string>com.pocketgophers.myapp</string>
<key>CFBundleURLTypes</key>
<array>
@nathankerr
nathankerr / filter.sh
Created February 29, 2012 16:48
bookmaker ps filter
#!/bin/bash
INPUT=`mktemp --tmpdir input.XXX`
OUTPUT=`mktemp --tmpdir output.XXX`
ps2pdf13 - $INPUT
chapbook.sh $INPUT $OUTPUT 2>&1 > /dev/null
pdf2ps $OUTPUT -
[ -e $INPUT ] && rm -f $INPUT
[ -e $OUTPUT ] && rm -f $OUTPUT
@nathankerr
nathankerr / .gitignore
Created November 17, 2010 13:57
Directory monitoring and program execution in Go
*.8
*.6
monitor
@nathankerr
nathankerr / clusterGIS-chaining.c
Created May 7, 2010 12:59
Alternative Approaches to Parallel GIS Processing
/* remove all residential parcels */
parcel = parcels->data;
head = &(parcels->data);
while(parcel != NULL) {
if(strncmp(parcel->data[2], "R", 1) == 0) {
head = &(parcel->next);
parcel = parcel->next;
} else {
*head = parcel->next;
clusterGIS_Free_record(parcel);
@nathankerr
nathankerr / HadoopGIS-create.java
Created May 7, 2010 12:27
Alternative Approaches to Parallel GIS Processing
if(key == 1008130) {
GIS created = new GIS();
GIS.update("\"97123897\",\"POLYGON((-112.0859375 33.4349975585938,-112.0859375 33.4675445556641,-112.059799194336 33.4675445556641,-112.059799194336 33.4349975585938,-112.0859375 33.4349975585938))\",\"C\"");
output.collect(new LongWritable(new Integer(97123897)), created);
}
output.collect(key, value);