Skip to content

Instantly share code, notes, and snippets.

Working from home

Jason Hall imjasonh

Working from home
View GitHub Profile
imjasonh / timerange.html
Created Jan 24, 2012
HTML abomination to select a time range [0, 23]
View timerange.html
<script type="text/javascript">
function get(id) {
return document.getElementById(id);
function updateLower() {
var value = get('lower').valueAsNumber;
get('upper').min = value + 1;
imjasonh / foursquare.v2.json
Created Feb 16, 2012
Discovery document for Foursquare API
View foursquare.v2.json
"kind": "discovery#restDescription",
"id": "foursquare:v2",
"name": "foursquare",
"version": "v2",
"title": "Foursquare API",
"description": "Is awesome.",
"icons": {
"x16": ""
imjasonh / background.html
Created Feb 21, 2012
Dart Chrome extension
View background.html
<script type="application/dart">
main() {
print('hello world');
<script type='text/javascript'>
if (navigator.webkitStartDart) {
View gist:2018190
public class MyEntryPoint implements EntryPoint {
public void onModuleLoad() {
private static final native void jsniAlert() /*-{
$wnd.alert("Called JSNI alert");
View gist:2018382
public class MyEntryPoint implements EntryPoint {
public void onModuleLoad() {
private static void staticMethod(int num) {
Window.alert("Static method called " + num);
private void instanceMethod(String str) {
imjasonh / pubsub.go
Created Sep 6, 2012
Simple HTTP server that enqueues subscribers and sends published messages to the oldest subscriber (and enqueues messages in case there are no subscribers)
View pubsub.go
package main
import (
const (
buffSize = 100
imjasonh / main.go
Created Dec 12, 2012
Script to copy your GitHub Downloads to Google Cloud Storage
View main.go
First go to, create a project, enable Cloud Storage in the "Services"
tab. Enable billing and create a bucket via the online browser. Then, run this script.
$ go build main.go -o copy_downloads && chmod +x copy_downloads && ./copy_downloads \
(Alternately, the build script is available at
imjasonh / mustlogin.go
Created Dec 19, 2012
Recipe to require that a user log in before reaching an http Handler func, without specifying it in app.yaml (similar to Python App Engine's @login_required decorator)
View mustlogin.go
package mustlogin
import (
func init() {
imjasonh / mustoauth.go
Last active Dec 10, 2015
Recipe to require that a user log in and go through an OAuth flow before reaching an http Handler func. This is similar to google-api-python-client's OAuth2Decorator ( This is based on the mustlogin.go gist here:
View mustoauth.go
package mustoauth
import (
imjasonh / perler.go
Last active Dec 15, 2015
Go script to read a png image like those found at to figure out how to make one with Perler beads (WIP)
View perler.go
package main
import (