Skip to content

Instantly share code, notes, and snippets.

View scottjbarr's full-sized avatar

Scott Barr scottjbarr

View GitHub Profile
@scottjbarr
scottjbarr / install-go
Last active November 8, 2016 00:45
Script that install a particular version of Go
#!/bin/bash
#
# Download and install a particular version of Go.
#
# Assumes versions are installed at ~/.go/versions/
#
# Author : Scott Barr
# Date : 23 Apr 2016
#
@scottjbarr
scottjbarr / .goconfig
Last active June 8, 2016 09:20
Install a particular version of Go on OS X. Assumes your Go versions are installed in ~/.go/versions. Setting your environment variables is up to you.
# Add Go related config here so you can source this file from ~/.bashrc
export GOPATH=$HOME/p/go
export PATH=$PATH:$GOPATH/bin
export GOROOT=~/.go/versions/go1.7beta1
export PATH=$GOROOT/bin:$PATH
@scottjbarr
scottjbarr / jwt_golang_example.go
Last active April 10, 2016 23:34 — forked from thealexcons/jwt_golang_example.go
JSON Web Token example
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
"time"
@scottjbarr
scottjbarr / gist.go
Created March 7, 2016 01:40 — forked from minikomi/gist.go
Golang script for creating anonymous gists with github API
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
@scottjbarr
scottjbarr / emacs-cheatsheet.md
Last active March 17, 2020 04:33
Emacs Cheatsheet

Emacs Cheatsheet

C : Control key

M : Meta key

General

C-g - Exit command

@scottjbarr
scottjbarr / gist:631b2cfef1389f7556f6
Created February 1, 2015 09:14
Keep SSH connections alive
# add this to the ~/.ssh/config
Host *
ServerAliveInterval 60
@scottjbarr
scottjbarr / nginx_vhost.conf
Last active December 18, 2019 00:25
Nginx - redirects php, asp, cgi (etc) to Recursive David Hasselhoff
server {
listen *:80;
root /u/apps/...;
passenger_enabled on;
passenger_ruby /usr/local/rvm/gems/ruby-2.2.0/wrappers/ruby;
rails_env staging;
client_max_body_size 20M;
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.7 (Darwin)
hQEMA71fr7dIWMeCAQgAscR1GbQPUWDPRPm/W9vaxlANRsXEWELRO/OTbgQZ0P0R
Y93db6vB+Jr419w2pRnoOGEzJbIGY/njvYJGyA73Izz+r1Tr38VQbfX3/AnFFj8G
lXbZL12lLy4NoGl88JvhfnF9oqNkbceKwR31hMFk/PYmdhOj7Zd8diRKygE7h/x6
8AvneUkMYiWsB5/rShuwwRsjePKl7FLI52u1jQM2cuyMifXFkbx+VpZPNnHe5sTA
J3FuWV/zOYhGWBgACDEoMF8EfnkpQIJvXzWT2ZLZqrYk/rddZXK3bLhkXhKwESx0
3Nx1mLSA2AsKFSsbU8A6wiTfyqdGxa3S5nkrcb+6doUBDgM9iImS797nMhAD/A1Y
vlKzb+UC5BmML/aXNcvcYJ6oxErE22hupMimivkmUaWvtG9W9cbZvDPMgpTADFFp

Keybase proof

I hereby claim:

  • I am scottjbarr on github.
  • I am scottjbarr (https://keybase.io/scottjbarr) on keybase.
  • I have a public key whose fingerprint is 45BF D99F D193 D57F 6F1E 9863 BD86 8213 4E96 094E

To claim this, I am signing this object:

@scottjbarr
scottjbarr / bitstamp_volume.txt
Created March 25, 2014 15:44
Bitstamp - Volume goes both directions
Anyone know why the value of "volume" goes up and down over time in the Bitstamp ticker?
2014-03-26 01:29:55 +1030 : {"last"=>578.27, "timestamp"=>1395759587, "volume"=>13123.56315962}
2014-03-26 01:30:06 +1030 : {"last"=>578.27, "timestamp"=>1395759597, "volume"=>13122.76327669}
2014-03-26 01:30:32 +1030 : {"last"=>575.0, "timestamp"=>1395759619, "volume"=>13140.92418922}
2014-03-26 01:30:42 +1030 : {"last"=>575.0, "timestamp"=>1395759631, "volume"=>13137.05772951}
2014-03-26 01:31:14 +1030 : {"last"=>575.0, "timestamp"=>1395759662, "volume"=>13141.85942981}
2014-03-26 01:31:30 +1030 : {"last"=>575.0, "timestamp"=>1395759675, "volume"=>13142.02797010}
2014-03-26 01:31:51 +1030 : {"last"=>575.0, "timestamp"=>1395759697, "volume"=>13141.92324196}
2014-03-26 01:33:31 +1030 : {"last"=>575.0, "timestamp"=>1395759793, "volume"=>13140.05760184}