Skip to content

Instantly share code, notes, and snippets.

View natbusa's full-sized avatar

Nate Busa natbusa

View GitHub Profile
@natbusa
natbusa / imagenet1000_clsid_to_human.txt
Created May 23, 2017 19:20 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class id to human readable labels
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@natbusa
natbusa / docker-cheat-sheat.md
Created March 29, 2017 08:34 — forked from dwilkie/docker-cheat-sheat.md
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@natbusa
natbusa / separate_digits.py
Last active November 2, 2016 09:27
Separate trailing digits from the rest of the string
import re
def trailing_digits(str):
m = re.search('^[0-9]*', str)
return (str[m.start():m.end()], str[m.end():])
#> trailing_digits('1234 hollywood boulevard')
#> ('1234', ' hollywood boulevard')
@natbusa
natbusa / oriole-spark.ipynb
Created August 1, 2016 18:26
Oriole - Anomaly detection and pattern extraction with Spark, Cassandra and Scala
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natbusa
natbusa / oriole-python.ipynb
Last active August 1, 2016 18:28
Oriole - Python geolocated clustering and predictive services
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natbusa
natbusa / clustering-venues.scala
Last active June 2, 2016 20:55
Clustering venues with Spark: The good, The bad, The ugly
// $SPARK_HOME/bin/spark-shell --master spark://localhost:7077 --packages com.datastax.spark:spark-cassandra-connector_2.10:1.5.0-M2 --conf spark.cassandra.connection.host=localhost
// let's do some data data science,
// Idea:
//
// venues exhibit a typical visit pattern during the week.
// Some venues are more checked in during the weekends, other during midweek.
// Let's apply machine learning to cluster venues which exhibit
// the same visiting behavior during the week.
@natbusa
natbusa / jsonapi.txt
Last active August 29, 2015 14:20
Gist REST Json API
// creation flow
POST /api/actors
{
"data" : {
"type": "actors",
"attributes": {
"type": "threashold",
"params": {
@natbusa
natbusa / flow.py
Created April 16, 2015 10:45
actor httpclient syntax/semantics ideas
from httpMethods import *
# Create the graph (profiling tags)
# get (as a http client) every 10 seconds json and emit it on
post('/api/actors',
{
"type":"httpclient",
"trigger": null, # can also be omitted altogether
"collect":null, # can also be omitted altogether
@natbusa
natbusa / linux pipes
Created March 19, 2015 10:13
scaling streaming computing
$> cat data.txt | grep "streming is awesome" > results.txt