Skip to content

Instantly share code, notes, and snippets.

View larsyencken's full-sized avatar

Lars Yencken larsyencken

View GitHub Profile
@larsyencken
larsyencken / grid.py
Created May 26, 2013 03:39
SimpleCV: create an arbitrary sized time delay grid from a camera feed, where each pane is a fixed delay from the previous pane
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# grid.py
#
"""
Generate a time-delayed grid of a camera feed.
"""
@larsyencken
larsyencken / delay.py
Created May 24, 2013 05:46
SimpleCV: play the video loop with a fixed frame delay
#
# delay.py
#
"""
Play the video loop with a frame delay.
"""
import SimpleCV
from collections import deque
@larsyencken
larsyencken / sound_delay.py
Last active December 10, 2020 11:13
PyAudio: record sound and play it back after a delay
#
# sound_delay.py
#
"""
Record sound and play it back after a delay.
"""
import multiprocessing as mp
import time
@larsyencken
larsyencken / running_median.py
Last active December 17, 2015 16:49
SimpleCV: running median image loop
#
# running_median.py
#
import SimpleCV
import numpy as np
import pygame
N = 5
@larsyencken
larsyencken / cedict_load.py
Last active December 17, 2015 12:39
Loading cedict using cjktools
# -*- coding: utf-8 -*-
# this finds the cedict file if cjktools-data is installed,
# otherwise just use the filename directly
from pkg_resources import resource_filename
cedict_file = resource_filename('cjktools_data', 'dict/ce_cedict')
# load cedict
from cjktools.resources import auto_format
cedict =auto_format.load_dictionary(cedict_file)
@larsyencken
larsyencken / bootstrap_docker.sh
Last active December 16, 2015 23:49
Bootstrap docker with Marelle
sed --in-place -e 's/archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list
apt-get update
apt-get install -y curl
bash -c "`curl -s https://bitbucket.org/larsyencken/marelle/raw/master/bootstrap.sh`"
@larsyencken
larsyencken / email_on_timeout.sh
Last active December 16, 2015 06:49
Bash script to set a time limit on a command and email if it's enforced
#!/bin/bash
#
# email_on_timeout
#
# A way to get notified when things take too long.
#
function usage()
{
cat << EOF 1>&2
@larsyencken
larsyencken / README.md
Last active December 15, 2015 09:09
Google Latitude export script

Google latitude export

Export your entire Google Latitude history to a local folder of CSV files, one per day.

1. Get an API key

Head over to Google's API Console and create a new project, with access to Google Latitude. Pick "installed application" as the project type, and once you've created it, download the client secrets file (client_secrets.json) and put it in the current directory.

2. Run the first export

@larsyencken
larsyencken / monitor-jobflows.py
Last active December 14, 2015 11:29
Monitor Elastic MapReduce jobflows for state changes, and announce them using OS X's say command.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# monitor-jobflows.py
#
"""
Monitors for changes in any jobflow's status and announces them.
"""
@larsyencken
larsyencken / workflow.d
Last active December 12, 2015 02:08
drake: minimal example of content-based dependencies
;
; workflow.d
;
; Minimal content-based dependency example
;
;
; recalculate md5 every time, overwite the old one only on change
; XXX we have to use an implicit input name
;