Skip to content

Instantly share code, notes, and snippets.

@tmarthal
tmarthal / gist:5286991
Last active December 15, 2015 16:09
Python time list filtering
import datetime
base = datetime.datetime.today()
dateList = [ base - datetime.timedelta(minutes=2*x) for x in range(0,48) ]
hour_ago = base - datetime.timedelta(hours=1)
# get the number of dates from less than an hour ago
len(filter(lambda x: x > hour_ago, dateList))
@andreas-h
andreas-h / r_stl.py
Created December 5, 2013 16:30
Python-wrapper for R's STL
# -*- coding: utf-8 -*-
import datetime
from numpy import asarray, ceil
import pandas
import rpy2.robjects as robjects
def stl(data, ns, np=None, nt=None, nl=None, isdeg=0, itdeg=1, ildeg=1,
nsjump=None, ntjump=None, nljump=None, ni=2, no=0, fulloutput=False):
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@szeitlin
szeitlin / docker_notes.txt
Last active June 11, 2016 18:23
notes from Gobridge-sponsored Docker workshop
Taught by Jerome Petazzo, 7November2015
>docker version #returns both the client and server versions of docker, Go, git, and OS
docker daemon and docker engine mean the same thing
docker user is root equivalent, you should restrict access to it, e.g.
>sudo groupadd docker
>sudo gpasswd -a $USER docker
@szeitlin
szeitlin / wrangleconf_notes.md
Last active August 3, 2016 02:36
Notes from WrangleConf 2016 in San Francisco
  1. When good algorithms go bad. Panel with Josh Wills of Slack, Anu Tewari of Intuit, John Bruner (sp?) of O'Reilly, moderated by Pete Skomoroch.

Pete asked: why are we surprised when things go wrong with real user data?

"I wear the black hat" by Chuck Closterman, idea that the villain is always the one who "knows the most and cares the least".

Josh said: our responsibility is to care. Example of 2009 Google toolbar app that provided info on browsing habits (early version of ad re-targeting) was deemed "too creepy to launch". Then someone else did it and "no one cared" maybe because when the ads are useful, it seems less intrusive?