This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
with open('leaguedashteamstats.json') as data_file: | |
data = json.load(data_file) | |
# extract headers names | |
headers = data['resultSets'][0]['headers'] | |
# extract raw json rows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias goplay='cd /go/src/github.com/cevaris' | |
export GOPATH=/go | |
export GOBIN=$GOPATH/bin | |
export PATH=$GOBIN:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TestFormatters { | |
val r = scala.util.Random | |
def textFormatter(x: Double) = new java.text.DecimalFormat("0.##").format(x) | |
def scalaFormatter(x: Double) = "$pi%1.2f".format(x) | |
def bigDecimalFormatter(x: Double) = BigDecimal(x).setScale(2, BigDecimal.RoundingMode.HALF_UP).toDouble |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install reattach-to-user-namespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -u | |
import itertools | |
import sys | |
import time | |
import thread | |
import threading | |
import random | |
from multiprocessing.dummy import Pool as ThreadPool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import itertools | |
import sys | |
import time | |
import threading | |
class Spinner(object): | |
spinner_cycle = itertools.cycle(['-', '/', '|', '\\']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import itertools | |
import sys | |
import time | |
import threading | |
class Spinner(object): | |
spinner_cycle = itertools.cycle(['-', '/', '|', '\\']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gitignore | |
func gitignore() { | |
curl https://raw.githubusercontent.com/github/gitignore/master/$1.gitignore | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
data = open('kafka-lag-logs.txt','r').readlines() | |
BASE_REGEX="Lag for group ([_\w]+) on partition ([-\w]+) \(([,\w]+)\)" | |
def extractData(row): | |
matches = re.findall(BASE_REGEX, row) | |
if matches: | |
group, partition, count = matches[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X "GET" "https://api.twitter.com/1.1/search/tweets.json?q=chicken" \ | |
-H "Authorization: Bearer MY_BEARER_TOKEN" |