Skip to content

Instantly share code, notes, and snippets.

View alphafoobar's full-sized avatar

James alphafoobar

View GitHub Profile
@alphafoobar
alphafoobar / gist:c4b42ced8706856f5eba72e311e58fbf
Created April 17, 2018 23:33
Install Docker on Linux mint
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
@alphafoobar
alphafoobar / ReFormat.java
Created January 29, 2018 11:01
Load OpenTSDB running locally with reformatted metrics
package nz.kaizen7.domain;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Instant;
@alphafoobar
alphafoobar / EtherDeltaTicker.js
Last active November 13, 2017 21:29
JavaScript Ticker for EtherDelta WebSocket API
const io = require('socket.io-client');
function Service() {
const self = this;
self.init = config => new Promise((resolve, reject) => {
self.config = config;
self.socket = io.connect(self.config.socketURL, { transports: ['websocket'] });
self.socket.on('connect', () => {
@alphafoobar
alphafoobar / ssh-common.sh
Last active July 4, 2017 09:59
Update terminal title when doing basic activities
#!/bin/bash
./terminal-title.sh $1 $2
ssh $2
[core]
editor = vi
autocrlf = input
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %C(bold blue)<%an>%Creset%C(green)(%cr)%Creset %s' --abbrev-commit
df = diff --color --color-words --abrev
co = checkout
cb = checkout -b
cd = checkout develop
cm = checkout master
@alphafoobar
alphafoobar / .bash_profile
Last active February 28, 2017 08:03
Config for mac os x
source ~/.profile
function tab_title() {
echo -n -e "\033]0;${PWD##*/}\007"
}
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}