Skip to content

Instantly share code, notes, and snippets.

View GeorgeErickson's full-sized avatar

George Erickson GeorgeErickson

View GitHub Profile
@GeorgeErickson
GeorgeErickson / patagonia.sh
Created December 19, 2017 19:45
gf wants a sweater that is out of stock
#!/usr/bin/env bash
set -euE -o pipefail -o noclobber
lookup() {
local matches=$(wget -qO- "http://www.patagonia.com/on/demandware.store/Sites-patagonia-us-Site/en_US/Product-Variation?pid=25542&dwvar_25542_color=TUCV&dwvar_25542_size=M" | pup '.availability-msg > p.in-stock-msg' | wc -l)
echo "$matches"
if [ "$matches" -gt 0 ]; then
terminal-notifier -message "in stock"
```json
{
// Currency pair.
// - Always uppercase
"pair": ["BTC", "USD"],
// decimal numbers are encoded as strings to avoid precision errors with floats.
// The best aggregated bid and ask price
@GeorgeErickson
GeorgeErickson / httptrace.awk
Created November 29, 2017 20:43
create a bare httptrace.ClientTrace implementation
#!/usr/bin/env -S awk -f
# usage: go doc httptrace.ClientTrace | trace.awk
BEGIN {
flag=0;
}
# check if we are inside the struct.
/{/ { flag=1 }
/}/ { flag=0 }
@GeorgeErickson
GeorgeErickson / Makefile
Last active December 12, 2017 22:41
protobuf makefile
OS := $(shell uname -s)
PROTO_VERSION := 3.0.2
PROTO_ZIP_FILE := /tmp/protoc-$(PROTO_VERSION).zip
PROTOC := /usr/local/bin/protoc-$(PROTO_VERSION)
ifeq ($(OS),Darwin)
PROTO_URL := https://github.com/google/protobuf/releases/download/v$(PROTO_VERSION)/protoc-$(PROTO_VERSION)-osx-x86_64.zip
PROTO_CHECKSUM := 06f7401ffe5211340692b0a16dc53f3d8f9dc8ef3c1f74378110ee222e36436d
else
PROTO_URL := "https://s3.amazonaws.com/dd-public-oss-mirror/protoc-$(PROTO_VERSION)-linux-x86_64.zip"
package main
import (
"bytes"
"fmt"
"math"
"strconv"
"strings"
"sync"
"testing"
@GeorgeErickson
GeorgeErickson / fix.patch
Last active November 29, 2016 01:30
Pycharm
diff --git i/pycharm/noserunner.py w/pycharm/noserunner.py
index ff45dba..9db9a9f 100644
--- i/pycharm/noserunner.py
+++ w/pycharm/noserunner.py
@@ -85,12 +85,12 @@ def process_args():
options = shlex.split(opts)
argv.extend(options)
- manager = DefaultPluginManager()
- manager.addPlugin(teamcity_plugin)

Keybase proof

I hereby claim:

  • I am georgeerickson on github.
  • I am geeio (https://keybase.io/geeio) on keybase.
  • I have a public key whose fingerprint is 10D8 D162 F2FB D103 C865 CCEA 4E4F A081 FA16 250D

To claim this, I am signing this object:

@GeorgeErickson
GeorgeErickson / check_go_dep.sh
Created May 25, 2015 00:21
Shit script for dep tracking
#!/usr/bin/env bash
set -eE -o pipefail
imports=$(go list -f '{{join .Imports "\n"}} {{join .TestImports "\n"}}' ./... | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | grep -v `go list -f '{{.ImportPath}}'` | sort)
godeps=$(awk '{print $1}' Godeps | sort)
gopath_all=$(cd $GOPATH && find . -type d -name '*.git' | cut -c 7- | sed 's/\/.git$//' | sort)
cmp_github() {
lp="${GOPATH%%:*}/src/${1%%/...}"
current=$(git -C $lp log -n 1 --pretty=oneline | cut -d " " -f 1)
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#fac32d",
"@brand-success": "#64b46a",
@GeorgeErickson
GeorgeErickson / install.sh
Created October 12, 2014 18:55
Installing graph-tool on a mac with homebrew and anaconda
brew install graph-tool