Skip to content

Instantly share code, notes, and snippets.

View jessearmand's full-sized avatar

Jesse Armand jessearmand

View GitHub Profile
@jessearmand
jessearmand / parse_json.py
Created October 29, 2012 13:05
Streaming JSON parser with ijson
#!/usr/local/bin/python
from sys import argv
import ijson
script, filepath = argv
f = open(filepath, 'r')
parser = ijson.parse(f)
for prefix, event, value in parser:
print "%r: %r - %r" % (event, prefix, value)
@jessearmand
jessearmand / osm_maps_downloader.py
Created November 6, 2012 14:26
Download map tiles from MapQuest open street map source
#!/usr/local/bin/python
from sys import argv
import os
import math
import urllib2
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
@jessearmand
jessearmand / unfuckbootstrap.sh
Created January 4, 2013 12:44
unfuckbootstrap from mikeash, when the simulator refused to launch your app
#!/bin/sh
launchctl list|grep UIKitApplication|awk '{print $3}'|xargs launchctl remove
#!/bin/bash
CWD=$(cd $(dirname $0); pwd)
HOME_DIR=$HOME
BASE_DIR="${HOME_DIR}/dev"
echo "Creating dev directory ${BASE_DIR}"
mkdir "${BASE_DIR}"
echo "Creating dev directory ${BASE_DIR}"
#!/bin/sh
#
# fleet-drone
#
# chkconfig: - 85 15
# description:
# processname: fleet-drone
# config: /etc/node/fleet-drone.conf
# pidfile: /var/run/fleet-drone.pid
@jessearmand
jessearmand / fleet-hub-init.sh
Created May 10, 2013 02:44
fleet hub init script from @tblobaum
#!/bin/bash
SET_USER="node"
SET_NODE_VERSION="v0.6.14"
SET_HUB_PORT="1024"
SET_HUB_SECRET="beepboop"
[ -d /etc/node ] || mkdir /etc/node
cat > /etc/node/fleet-hub.conf <<EOT
@jessearmand
jessearmand / module_test.rb
Last active December 18, 2015 02:29
Some module test
module Debug
def whoAmI?
"#{self.name} (\##{self.id}): #{self.to_s}"
end
end
module Debugger
def whoAmI?
"#{self.id}: #{self.to_s}"
end
@jessearmand
jessearmand / utilitiesCost.hs
Last active December 30, 2015 05:29
A simple haskell module to calculate utilties cost.
module UtilitiesCost
( electricityCost
, gasCost
, waterCost
, utilitiesCost
) where
import Debug.Trace
data Reading = Reading Double Double deriving (Eq, Show, Read)
@jessearmand
jessearmand / set-xcode-plugin-uuid.sh
Created March 11, 2014 04:16
Set Xcode plugin UUID compatibility
#!/bin/sh
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
defaults write ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/$1.xcplugin/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID