Skip to content

Instantly share code, notes, and snippets.

View kylehotchkiss's full-sized avatar
👨‍💻
Javascript

Kyle Hotchkiss kylehotchkiss

👨‍💻
Javascript
View GitHub Profile
@kylehotchkiss
kylehotchkiss / launchpad.py
Created August 16, 2011 03:52
Got sick of seeing adobe's crap in my Launchpad. Also didn't like the ghetto air based options for fixing that. This currently straight up deletes the item from your Launchpad DB, but you can reset it back if you want. It's open source, so make it your ow
##
## Launchpad Editor
## Copyright 2011 Hotchkissmade
## Released under the GPL
##
import sqlite3, operator, sys, os
try:
path = os.path.expanduser("~") + "/Library/Application Support/Dock/"
@kylehotchkiss
kylehotchkiss / grads.js
Created August 27, 2012 16:47
This is a rather painful piece of code that gets wind data from NOAA's servers. Node.js/Async.js. You're welcome.
/**
*
* fnstraj | GrADS Functions
* Copyright 2011-2012 Hotchkissmade
* Released under the GPL
*
* grads.wind - return wind speed and direction.
*
*/
@kylehotchkiss
kylehotchkiss / gradscache.js
Created August 29, 2012 17:03
Sample Gradscache / Got those damn ucomps back in there (champ!) [Represents trajectory prediction for a flight between Fredericksburg, Virginia and Baltimore, MD.]
[ 'ugrdprs[8][0][85][366]': '10.6',
'vgrdprs[8][0][85][366]': '10.6',
'ugrdprs[8][1][85][366]': '11.1',
'vgrdprs[8][1][85][366]': '11.1',
'ugrdprs[8][2][85][366]': '11.7',
'vgrdprs[8][2][85][366]': '11.7',
'ugrdprs[8][3][85][366]': '13.0',
'vgrdprs[8][3][85][366]': '13.0',
'ugrdprs[8][4][85][366]': '13.793909',
'vgrdprs[8][4][85][366]': '2.006661',
ar social = function() {
jQuery("a[href*='twitter.com/intent']").unbind();
var socialpopup = function( url, title, width, height ) {
var top = ( screen.height / 2 ) - ( height / 2 );
var left = ( screen.width / 2 ) - ( width / 2 );
window.open( url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left );
};
@kylehotchkiss
kylehotchkiss / midpoint.htm
Created December 15, 2012 17:42
Here's a coordinate midpoint calculator. Useful for displaying maps with lots of points... and centering them better?
<!DOCTYPE html>
<html>
<head>
<title>Coordinate Midpoint Calculator</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
var RADIANS = Math.PI / 180;
var DEGREES = 180 / Math.PI;
@kylehotchkiss
kylehotchkiss / worker.js
Created January 21, 2013 22:48
HOW NOT TO WRITE A DAEMON/QUEUE SYSTEM
/**
*
* FNSTraj | Worker Process
* Copyright 2011-2012 Hotchkissmade
* Released under the GPL
*
*/
var http = require("http");
var fnstraj = require("./predictors/fnstraj.js");
@kylehotchkiss
kylehotchkiss / coordsToLocation.js
Last active December 11, 2015 18:19
Easy coordinates-to-location-name via Google Maps API. You're welcome.
jQuery.getJSON("http://maps.googleapis.com/maps/api/geocode/json?address=" + latitude + ',' + longitude + "&sensor=true", function( data ) {
var components = data.results[0].address_components;
for ( level in components ) {
if (components[level].types[0] === "locality" || components[level].types[0] === "administrative_area_level_2" || components[level].types[0] === "administrative_area_level_1" ) {
locale = components[level].short_name;
break;
}
}
@kylehotchkiss
kylehotchkiss / database.php
Last active December 12, 2015 05:08
Database interface functions in PHP.
<?php
/**
*
* fnstraj frontend | database wrapper
* Copyright 2011-2013 Kyle Hotchkiss
* Released under the GPL
*
* Aiming for API compatibility with fnstraj
* located at > fnstraj/library/database.js <
*
@kylehotchkiss
kylehotchkiss / database.js
Created March 7, 2013 14:56
Here's a Node.JS-CouchDB wrapper.
/**
*
* fnstraj | Simple CouchDB Wrapper
* Copyright 2011-2013 Kyle Hotchkiss
* Released under the GPL
*
* Needs checkup (HEAD) check to verify that we're good to
* continue forward with Daemon execution.
*
*/
@kylehotchkiss
kylehotchkiss / flight.json
Created March 24, 2013 19:01
How long would this take to table-ize?
{
"_id" : "1363975475",
"_rev" : "1-b4dab98ce01f55526c19733988982552",
"analysis" : {
"points" : {
"burst" : {
"index" : 57,
"latitude" : 37.43120734417338,
"longitude" : -78.55404367043889,
"altitude" : 32747.3439370399