Skip to content

Instantly share code, notes, and snippets.

View larsyencken's full-sized avatar

Lars Yencken larsyencken

View GitHub Profile
@larsyencken
larsyencken / edit.py
Last active February 16, 2016 10:34
Lifesum: edit distance
# -*- coding: utf-8 -*-
#
# edit.py
# code-library
#
"""
Implementation of edit distance.
"""
@larsyencken
larsyencken / snippet.py
Created February 1, 2016 12:46
IPython notebook theming with Seaborn
# avoid false precision on floating point numbers
%precision 3
pd.set_option('display.precision', 3)
# use seaborn for nice theming
import seaborn as sns
# up the font sizes on graphs
sns.set_context("notebook", font_scale=1.5, rc={"lines.linewidth": 2.5})
@larsyencken
larsyencken / README.md
Last active August 29, 2015 14:08
Canoe polo draw creator

rod-polo-draw

Generate a good canoe polo draw.

Requirements

Runs on Python 3, with click installed (pip install click).

Usage

@larsyencken
larsyencken / bootstrap.sh
Last active August 29, 2015 14:07
Bootstrap a new Mac just as I like it
#!/bin/bash
#
# bootstrap.sh
#
# Bootstrap a new Mac.
#
set -e
declare -a BREWS
@larsyencken
larsyencken / .gitignore
Last active August 29, 2015 14:05
Stock analysis: AFI
.ipynb_checkpoints
@larsyencken
larsyencken / shuihuzhuan.txt
Created June 12, 2014 23:36
Translated names of heroes from "Warriors of the Marsh" (水滸傳, shuǐ hǔ zhuàn)
Arrow−Struck Tiger
Big Halberd
Black Whirlwind
Boat Flame
Comet
Demon Carver
Demon Face
Demon King Who Roils the World
Dragon from the Cave
Dragon from the Forest
@larsyencken
larsyencken / aws_profile
Created June 5, 2014 04:23
Switch between AWS accounts
#!/bin/bash
#
# aws_profile
#
# Manages multiple AWS accounts through symlinks.
#
if [ ! -d ~/.aws ]; then
echo "ERROR: can't find \${HOME}/.aws directory" 1>&2
exit 1
@larsyencken
larsyencken / README.md
Last active August 29, 2015 13:58
Building opencv on OS X 10.9 Mavericks

Here's my saga. It's heavily based on this earlier gist, but adapted for Mavericks. I'm starting off from pyenv running anaconda-1.9.1.

I tried several versions, but only 2.4.8 compiled successfully for me.

wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip
unzip opencv-2.4.8.zip
cd opencv-2.4.8
@larsyencken
larsyencken / tempdir.sh
Created April 2, 2014 00:15
Make and enter a temporary scratch directory
#!/bin/bash
#
# tempdir
#
# Enter a temporary scratch space directory.
#
d="$(mktemp -d)"
(
echo "Entering $d"

Keybase proof

I hereby claim:

  • I am larsyencken on github.
  • I am larsyencken (https://keybase.io/larsyencken) on keybase.
  • I have a public key whose fingerprint is 6416 1FA2 9212 A9B2 7986 EDEB AC54 051E 3C7B 7B03

To claim this, I am signing this object: