Skip to content

Instantly share code, notes, and snippets.

View thejefflarson's full-sized avatar
👨‍👩‍👧‍👦
being a dad

Jeff Larson thejefflarson

👨‍👩‍👧‍👦
being a dad
View GitHub Profile
@harrisj
harrisj / tinyurl_test.rb
Created April 26, 2012 16:44
Testing Punctuation on URL Shorteners
require 'net/http'
# These links were taken from my twitter timeline. No endorsement implied.
tiny_urls = {
'bitly' => ['http://bit.ly/3S9c5K', 'http://developer.nytimes.com/'],
'j.mp' => ['http://j.mp/JsML0u', 'http://www.npr.org/2012/04/26/151303230/an-african-trader-and-the-perils-of-business-in-china'],
'tinyurl' => ['http://tinyurl.com/6rq9vob', 'http://politicsoftheplate.com/?p=1283'],
'owly' => ['http://ow.ly/axesj', 'http://threatpost.com/en_us/blogs/opera-12-beta-released-new-security-features-including-do-not-track-support-042612'],
'ht.ly' => ['http://ht.ly/1j7LiX', 'http://rssfeeds.usatoday.com/~r/usatoday-LifeTopStories/~3/8vFV-fFfhAc/1'],
'is.gd' => ['http://is.gd/gk0FoM', 'http://www.wired.com/dangerroom/2012/04/joe-schmoe-drones/'],
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@kleinmatic
kleinmatic / ascii.txt
Created March 25, 2012 04:05
ASCII character 28. Used by the Federal Election Commission as a field delimiter, so it's useful when working with some FEC files. How to Use: Download or clone, open in any competent plain-text editor and use the regular means to add it to your clipboard

@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@zhm
zhm / gist:2005158
Last active February 28, 2022 17:11
Building GDAL 1.9 with ESRI FileGDB support on OS X Lion

Building GDAL 1.9.x with ESRI FileGDB support on OS X Lion

  • Download the SDK from ESRI's website http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api
  • Extract the SDK, and put the contents of the directory in a known location, I used ~/local/filegdb. Here's an example path to one of the files: ~/local/filegdb/lib/libFileGDBAPI.dylib
  • I use ~/local/filegdb so it can stay isolated in it's own place. You can put it anywhere, but the next few steps might be different.
  • Go into the directory containing the FileGDB SDK, e.g. ~/local/filegdb
  • ESRI built these dylib's using @rpath's, so to avoid needing to mess with DYLD_LIBRARY_PATH, I updated the @rpath's using install_name_tool. There might be a more elegant way to handle this. If so, comments are welcome!
  • Here are the commands I used to patch the dylibs, this is not required if you want to use DYLD_LIBRARY_PATH yourself:
@myersjustinc
myersjustinc / mercator.html
Created November 14, 2011 19:12
Mercator scale factors by latitude
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mercator craziness</title>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">//<![CDATA[
var map;
var circles = [];
function degToRad(degrees) {return degrees * Math.PI / 180;}
// Demonstration of dynamic super() calls.
// Because of JS reserved words, "ssuper()" is the method name,
// and is passed the current object, as well as the name of
// the current method.
function GreatGrandParent() {};
GreatGrandParent.prototype.method = function() {
console.log("In the GreatGrandParent.");
};
$ curl -I http://t.co/a87DAaC
HTTP/1.1 301 Moved Permanently
Date: Sat, 20 Aug 2011 22:53:39 GMT
Server: hi
Location: http://nyti.ms/p8ZGNT
Cache-Control: private,max-age=300
Expires: Sat, 20 Aug 2011 22:58:39 GMT
Connection: close
Content-Type: text/html; charset=UTF-8
@tlrobinson
tlrobinson / Makefile
Created June 25, 2011 03:31
Remote Makefiles fun
MAKEFILE=$(lastword $(MAKEFILE_LIST))
REMOTE?=$(REMOTE_USER)@$(REMOTE_HOST)
REMOTE_SSH?=ssh -p $(REMOTE_PORT)
REMOTE_SHELL?=$(REMOTE_SSH) $(REMOTE) $(REMOTE_LOGIN)
REMOTE_MAKE?=cat $(MAKEFILE) | $(REMOTE_SHELL) make -f /dev/stdin -C $(REMOTE_BASE)
# LOCAL COMMANDS:
hello:
@ryanpitts
ryanpitts / Hartnett Command Performance
Created May 11, 2011 19:11
Let your Mac read you the latest @wmhartnett updates from Twitter
read -a choices <<<'Agnes Kathy Princess Vicki Victoria Bruce Fred Junior Ralph Albert Bahh Bells Boing Bubbles Cellos Deranged Hysterical Trinoids Whisper Zarvox'; n=${#choices[*]}; voice=${choices[$((RANDOM%n))]}; curl https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=wmhartnett | grep '<description>.*</description>' | sed -e 's/<\/*description>//g' -e 's/ \/ wmhartnett//g' -e 's/wmhartnett: //g' | say -v $voice