Skip to content

Instantly share code, notes, and snippets.

View wrobstory's full-sized avatar

Rob Story wrobstory

View GitHub Profile
@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
@john2x
john2x / 00_destructuring.md
Last active May 29, 2024 00:25
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@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).
@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 )
@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))
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png