Skip to content

Instantly share code, notes, and snippets.


Micah Elliott MicahElliott

View GitHub Profile
MicahElliott /
Created Nov 29, 2010
Download and Convert youtube "favorite" videos to MP3.
#! /usr/bin/env python
""" youtube2mp3 - Download and Convert youtube "favorite" videos to MP3.
Determine "favorited" vids, download them as FLVs, extract/ save its
MP3, meanwhile fixing up file names.
Assumes most (or all) of the things you "favorite" on Youtube are some
sort of musical recording. I've found a lot of old jazz tunes on Youtube
that I can't otherwise find recordings for. Down side is that the
MicahElliott / about.rb
Created Nov 29, 2010
A still-concise extension of the standard ‘file’ info.
View about.rb
#! /usr/bin/env ruby
# about — A still-concise extension of the standard ‘file’ info.
# Author: Micah Elliott
# License: WTFPL
# Combine standard file utils (eg, file, wc, head, tail, sort, stat) to
# give pieces of information about a file. Informs about file length,
# sorted-ness, and other meta-data.
MicahElliott / syntax-python.vim.patch
Created Dec 9, 2010
Patch to add special comments support to v3.0.6 for vim python syntax.
View syntax-python.vim.patch
--- py3-orig.vim 2010-12-09 09:46:45.311794900 -0800
+++ py3.vim 2010-12-09 10:35:17.895552660 -0800
@@ -137,7 +137,21 @@
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
syn match pythonRun "\%^#!.*$"
syn match pythonCoding "\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
-syn keyword pythonTodo TODO FIXME XXX contained
+" Special non-standard comment types, to rainbow-ify your code.
+syn match pythonCommentedCode "##\w.*$" display
MicahElliott / python.vim
Created Dec 10, 2010
Add special comments support to v3.0.6 for vim python syntax.
View python.vim
" Vim syntax file
" Language: Python
" Maintainer: Dmitry Vasiliev <>
" URL:
" Last Change: 2010-11-14
" Filenames: *.py
" Version: 3.0.6
" Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <>
MicahElliott / pysel.zsh
Created Dec 15, 2010
Python (Version) Selector (and Activator)
View pysel.zsh
# Zsh (to be ‘source’d)
# Python (Version) Selector (and Activator)
# Prompts user with a menu of installed Pythons with their version
# string and path. Their choice results in an alias that hides any
# invocation of ‘python’.
# Potentially useful for setups with multiple ‘pip’s,
# ‘virtualenv[wrapper]’s, etc.
MicahElliott /
Created Jun 3, 2011
ecd — Enhanced CD (for bash)
# ecd — Enhanced CD (for bash)
# Author: Micah Elliott
# License: WTFPL
# Usage: source .../; cd ...
# (Don’t try to run this file; it is to be sourced)
# Useful aliases:
# alias cdl='cd -l'

flickpapr — Randomly choose an “interesting” flickr photo for desktop wallpaper.


About Flickr Interestingness

Flickr’s interestingness heuristics generate some lovely images. People visit every day and just click “Refresh” to see page after page of these. BUT… it’s much better just have these

MicahElliott /
Created Feb 29, 2012
Impose time/timeout threshold on command running time (POSIX & Windows)
#! /usr/bin/env python
import sys, time, os
from timeout import timeOut
def testNoisyGraceful():
sys.stdout.write('NoisyGraceful:'); sys.stdout.flush()
t0 = time.time()
#cmd = r'python -c "import time; time.sleep(10); print 1 * 4096"'
cmd = 'python 1 4096'
MicahElliott / gitmulti.csv
Created Apr 9, 2012
gitmulti -- a collection of git repos
View gitmulti.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
MicahElliott /
Created Apr 9, 2012
Installing an unhosted jar dependency (though clojure source on github)

Installing an unhosted jar dependency (though source on github)

In this example I'm setting up doc-test with lein for a new project.

Create a new project.

% lein new my-proj
% cd my-proj