Skip to content

Instantly share code, notes, and snippets.

View larsyencken's full-sized avatar

Lars Yencken larsyencken

View GitHub Profile

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:

@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"
@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 / 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 / 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 / .gitignore
Last active August 29, 2015 14:05
Stock analysis: AFI
.ipynb_checkpoints
@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 / 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 / human_size.py
Created September 23, 2011 03:58
Pretty prints a size in bytes
def human_size(s):
"""
Given a size interval in seconds, return it pretty-printed.
>>> human_size(875)
'875b'
>>> human_size(3037)
'3.0Kb'
>>> human_size(3691234)
'3.7Mb'
@larsyencken
larsyencken / human_time.py
Created September 23, 2011 03:53
Pretty print time in seconds
def human_time(s):
"""
Given a time interval in seconds, return it pretty-printed.
>>> human_time(3.234)
'3.2s'
>>> human_time(91)
'1m 31s'
>>> human_time(3691)
'1h 1m'