Skip to content

Instantly share code, notes, and snippets.

// Transliteration of a couple functions from PROJ.4 to JavaScript.
// I have absolutely no idea how any of this works.
/** Some constants that PROJ uses for the WGS84 ellipse projection.*/
var G_A = 6378137;
var G_ONEF = 0.99664718933525254;
var G_FLAT4 = 0.00083820266618686579;
var G_FLAT64 = 1.756459274006926e-07;
var METERS_TO_MILES = 0.00062136994949494966;
var DTOL = 1e-12;
@ttjoseph
ttjoseph / gist:1360495
Created November 12, 2011 13:06
Real diagnosis codes
799.89HG Not feeling great
799.98HC Does not feel right
E000.8C Hobby not done for income
E892 Conflagration not in building or structure
E892A Fire not in building
E906.8AV Pecked by turkey
E906.8BS Struck by turkey
@ttjoseph
ttjoseph / itascrape.py
Created July 3, 2010 15:59
Finds the cheapest place for a bunch of people to fly to by screen-scraping ITA Software's Matrix fare search site
#!/usr/bin/python
import urllib, urllib2
import re, cookielib
import os, time, sys
from BeautifulSoup import BeautifulSoup
COOKIE_FILE = 'cookies.dat'
BASE_URL = "http://matrix1.itasoftware.com"
INIT_URL = BASE_URL + "/cvg/dispatch"
var http = require("http"),
sys = require("sys");
function read(callback) {
connection = http.createClient(8000, "127.0.0.1");
var request = connection.request("GET", "/");
request.addListener("response", function (response) {
var responseBody = "";
response.setBodyEncoding("utf8");
response.addListener("data", function(chunk) {
responseBody += chunk;