Skip to content

Instantly share code, notes, and snippets.

Jason Hall ImJasonH

Block or report user

Report or block ImJasonH

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sockethttp.go
package sockethttp
import (
"appengine"
"appengine/socket"
"net/http"
)
// NewClient returns a new http.Client that uses the Sockets API to make requests.
@ImJasonH
ImJasonH / drive.go
Last active Aug 29, 2015
Script to upload a file to Drive, request it be converted to spreadsheet, then export it as CSV
View drive.go
package main
import (
"encoding/json"
"flag"
"io"
"log"
"net/http"
"os"
"strings"
@ImJasonH
ImJasonH / app.go
Last active Aug 29, 2015
code.google.com web hook -> fetch archive -> upload to GCS
View app.go
package foo
import (
"archive/tar"
"compress/gzip"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
@ImJasonH
ImJasonH / gist:e1d970122caa5f2e4a6a
Created May 22, 2014
HTTP server that serves a randomly generated-on-the-fly GIF (using https://gist.github.com/ImJasonH/7b309a4af2d4e32a2649)
View gist:e1d970122caa5f2e4a6a
package main
import (
"image"
"image/color"
"image/color/palette"
"log"
"math/rand"
"net/http"
"time"
@ImJasonH
ImJasonH / writer.go
Last active Aug 29, 2015
Incremental GIF writer (heavily borrowed from standard library's gif.EncodeAll) -- allows frames to be added on demand
View writer.go
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package supergif
import (
"bufio"
"compress/lzw"
"errors"
View gnod.go
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"path"
@ImJasonH
ImJasonH / usps.go
Last active Aug 29, 2015
Go script to ping the USPS package tracking API
View usps.go
package main
import (
"encoding/xml"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
@ImJasonH
ImJasonH / noaa.go
Last active Aug 29, 2015
Go script to parse NOAA data
View noaa.go
// 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 Aug 29, 2015
Tros lets you Sort Go structs using reflection. Get it?
View gist:25f08ceca12fcd4cb586
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)
You can’t perform that action at this time.