Skip to content

Instantly share code, notes, and snippets.

View wrobstory's full-sized avatar

Rob Story wrobstory

View GitHub Profile
@jrmontag
jrmontag / git-branch-prompt
Last active August 29, 2015 13:56
git branch in prompt (minimal working example)
# (ubuntu)
# add to end of .bashrc :
export PS1="\$(__git_ps1) "$PS1
# gives e.g. (when in a repo):
(master) user@host:~$
# more info: http://stackoverflow.com/questions/15883416/adding-git-branch-on-the-bash-command-prompt
@johnmyleswhite
johnmyleswhite / gist:14dbd928019669faef82
Last active August 29, 2015 14:06
Benchmarking Resources
Q: what book should i use to learn ML?
A: use several, and find the one that speaks to you.
the list below assumes you know a bit of math but
are not very mathematical, and are interested in learning
enough to be practical. that is, it is not at the
mathematical level of MIJ's alleged list
(cf. https://news.ycombinator.com/item?id=1055389 )
@marcprux
marcprux / index.html
Last active December 16, 2015 15:29
<html>
<head>
<title>Vega Object Constancy Issue Demo</title>
<script src="http://trifacta.github.com/vega/d3.v3.min.js"></script>
<script src="http://trifacta.github.com/vega/vega.js"></script>
</head>
<body>
<div id="vis"></div>
</body>
<script type="text/javascript">
[{"0500000US33009": 4.5, "0500000US38041": 3.5, "0500000US38043": 6.4, "0500000US39069": 9.7, "0500000US38045": 3.0, "0500000US38047": 3.0, "0500000US33001": 5.6, "0500000US33000": 5.4, "0500000US33003": 5.4, "0500000US33005": 5.3, "0500000US47159": 9.4, "0500000US33007": 7.6, "0500000US19175": 5.5, "0500000US19177": 7.1, "0500000US46095": 5.8, "0500000US19171": 6.9, "0500000US19173": 4.6, "0500000US24045": 9.0, "0500000US24047": 12.2, "0500000US24510": 10.5, "0500000US19179": 7.6, "0500000US48373": 9.7, "0500000US24043": 9.8, "0500000US46093": 5.0, "0500000US55103": 7.0, "0500000US46091": 6.6, "0500000US26009": 12.3, "0500000US31183": 3.6, "0500000US31181": 4.4, "0500000US31185": 4.5, "0500000US49041": 7.4, "0500000US49043": 6.1, "0500000US39067": 10.3, "0500000US49047": 5.1, "0500000US56000": 6.0, "0500000US18155": 7.0, "0500000US18157": 7.7, "0500000US18151": 10.2, "0500000US18153": 10.1, "0500000US29021": 7.4, "0500000US55029": 10.6, "0500000US29023": 8.2, "0500000US18159": 10.3, "0500000US29027": 7.5, "0
@marcprux
marcprux / index.html
Created April 25, 2013 16:53
Resizable stacked bar chart using vega+d3+svg
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Visualization</title>
<meta
charset="UTF-8" />
<meta
http-equiv="Content-type"
content="text/html;charset=UTF-8" />
@fonnesbeck
fonnesbeck / install_superpack.sh
Created May 16, 2014 04:10
Script to install Python scientific stack ("Scipy Superpack") using Homebrew and pip. Uses Homebrew's Python 2.7.6. Please report any issues in the comments.
#!/bin/sh
hash brew &> /dev/null
if [ $? -eq 1 ]; then
echo 'Installing Homebrew ...'
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
fi
# Ensure Homebrew formulae are updated
brew update
@jneen
jneen / variant-multimethods.clj
Created November 22, 2014 20:55
Multimethods with variants
; it's a bit cumbersome to set up and there's the unfortunate need to ignore the tag
; in the individual methods, but this allows you to leave the interpretation of open
; variants, well, *open* for extension by multimethod.
; dispatch off the first argument, which will be the tag
(defmethod command-multi (fn [tag & data] tag))
; the first argument to the *method* is still the tag
(defmulti command-multi :print [_ val] (println val))
(defmulti command-multi :read [_ fname] (slurp fname))
@ptaoussanis
ptaoussanis / transducers.clj
Last active December 17, 2021 13:54
Quick recap/commentary: Clojure transducers
(comment ; Fun with transducers, v2
;; Still haven't found a brief + approachable overview of Clojure 1.7's new
;; transducers in the particular way I would have preferred myself - so here goes:
;;;; Definitions
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as:
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation
;; (The `[]` arity is actually optional; it's only used when calling
;; `reduce` w/o an init-accumulator).
@kwmsmith
kwmsmith / pairwise_cython.pyx
Last active August 12, 2022 04:25
Numba vs. Cython: Parallel Cython with OMP
#cython:boundscheck=False
#cython:wraparound=False
import numpy as np
from cython.parallel cimport prange
from libc.math cimport sqrt
cdef inline double dotp(int i, int j, int N, double[:, ::1] X) nogil:
cdef:
int k