Skip to content

Instantly share code, notes, and snippets.

View imjasonh's full-sized avatar
🏠
Working from home

Jason Hall imjasonh

🏠
Working from home
View GitHub Profile
@imjasonh
imjasonh / noaa.go
Last active October 28, 2021 06:22
Go script to parse NOAA data
// See ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt
package main
import (
"archive/tar"
"compress/gzip"
"errors"
"flag"
"fmt"
@imjasonh
imjasonh / README.md
Last active October 28, 2021 06:22
Tros lets you Sort Go structs using reflection. Get it?
@imjasonh
imjasonh / gist:25f08ceca12fcd4cb586
Last active October 28, 2021 06:21
bqwiki notes
startup.sh
==========
set -e
set -x
DUMPFILE=$(curl http://metadata/computeMetadata/v1/instance/attributes/dumpfile -H "Metadata-Flavor: Google")
echo dumpfile $DUMPFILE
VMID=$(curl -s http://metadata/computeMetadata/v1/instance/hostname -H "Metadata-Flavor: Google" 2>&1 | cut -d. -f1)
@imjasonh
imjasonh / progress.go
Last active October 28, 2021 06:21
Playing around with github.com/cheggaaa/pb
package main
import (
"flag"
"io/ioutil"
"log"
"net/http"
"strconv"
"github.com/cheggaaa/pb"
@imjasonh
imjasonh / ghcommits.html
Created August 18, 2014 15:28
Display commits to a file on a slider -- http://jsfiddle.net/poLx4kgk/
<html><head>
<style>
input[type=range] {
width: 100%;
}
</style></head>
<body>
<label for="repo">Repo</label><input type="text" id="repo" value="golang/oauth2" onchange="go()"></input><br />
<!-- TODO: dropdown? autocomplete? -->
@imjasonh
imjasonh / .travis.yml
Last active October 28, 2021 06:21
Travis CI config using "goapp test"
language: go
go:
- 1.4
install:
- wget https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.17.zip
- unzip -q go_appengine_sdk_linux_amd64-1.9.17.zip
- export PATH=$PATH:$PWD/go_appengine/
@imjasonh
imjasonh / backoff.go
Last active November 23, 2021 00:37
BackoffTransport implements exponential backoff for HTTP requests
package httpbackoff
import (
"bytes"
"fmt"
"io"
"math/rand"
"net/http"
"time"
)
@imjasonh
imjasonh / LICENSE
Last active October 28, 2021 06:20
Maps API client in Go
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@imjasonh
imjasonh / image.gif
Last active October 28, 2021 06:20
Example app to generate a spinny StreetView gif at a location
image.gif
@imjasonh
imjasonh / get.sh
Last active October 28, 2021 06:19
#!/bin/bash
set -e
set -x
LIMIT=10000
for h in `seq 0 23`
do
for d in `seq 1 7`