This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew doctor | |
Your system is raring to brew. | |
$ brew --config | |
HOMEBREW_VERSION: 0.9 | |
HEAD: 506e48d7c5c0875daec12b189206e59f02bc31ab | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit core2 | |
OS X: 10.6.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Homebrew 0.9 | |
==> Upgrading glib | |
==> Downloading ftp://ftp.gnome.org/pub/gnome/sources/glib/2.30/glib-2.30.3.tar.xz | |
Already downloaded: /Users/smithm5/Library/Caches/Homebrew/glib-2.30.3.tar.xz | |
xz -dc "/Users/smithm5/Library/Caches/Homebrew/glib-2.30.3.tar.xz" | /usr/bin/tar xf - | |
==> Downloading patches | |
/usr/bin/curl -qf#LA Homebrew 0.9 (Ruby 1.8.7-249; Mac OS X 10.6.8) https://trac.macports.org/export/87537/trunk/dports/devel/glib2/files/patch-configure.diff -o 000-homebrew.diff https://trac.macports.org/export/87537/trunk/dports/devel/glib2/files/patch-glib-2.0.pc.in.diff -o 001-homebrew.diff https://trac.macports.org/export/87537/trunk/dports/devel/glib2/files/patch-glib_gunicollate.c.diff -o 002-homebrew.diff https://trac.macports.org/export/87537/trunk/dports/devel/glib2/files/patch-gi18n.h.diff -o 003-homebrew.diff https://trac.macports.org/export/87537/trunk/dports/devel/glib2/files/patch-gio_xdgmime_xdgmime.c.diff -o 004-homebrew.diff https://trac.macports.org/export/87537/trunk/dports/devel/glib2/fil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-7] worker got EOFError or IOError -- exiting | |
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-8] worker got EOFError or IOError -- exiting | |
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-7] worker exiting after 0 tasks | |
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-8] worker exiting after 1 tasks | |
[2012-05-02 14:21:39,374: INFO/PoolWorker-7] process shutting down | |
[2012-05-02 14:21:39,374: INFO/PoolWorker-8] process shutting down | |
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-8] running all "atexit" finalizers with priority >= 0 | |
[2012-05-02 14:21:39,374: DEBUG/PoolWorker-7] running all "atexit" finalizers with priority >= 0 | |
[2012-05-02 14:21:39,375: DEBUG/PoolWorker-8] running the remaining "atexit" finalizers | |
[2012-05-02 14:21:39,375: DEBUG/PoolWorker-7] running the remaining "atexit" finalizers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Translate avro into json and pretty print it. | |
from avro import schema | |
from avro.io import BinaryDecoder, DatumReader | |
from json import dumps | |
from sys import argv | |
def read_avro(avro_file_no_schema, avro_schema): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2>/dev/null wget -O- http://www.law.uchicago.edu/alumni/magazine/feed.rss | cat -e | grep -F 'In juven' | |
<p> ^RIn juvenile justice proceedings, the developmental deficits the adolescents bring to court can also be expected to be great. And because their offending reflects problematic decision making and a certain openness to defining themselves as outside of, or even in opposition to, the system of laws and legal actors that govern them, we should be particularly eager to afford these young people opportunities to develop their decision-making competence and engage with government actors in positive ways.</p>$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
generate_lines() { | |
local length=$1 # Generate this many lines. | |
local input_file=$2 # Leave $2 and $3 empty to generate an independant file. | |
local -i input_length # The number of lines in the input file. | |
local freq_dupes=$(( ${3:-length+1} )) # Copy a line from $input every $freq_dupes iterations | |
if [[ -r $input_file ]]; then | |
input_length=$(( $(wc -l < "$input_file") )) | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logchanged() { | |
local thiscommit | |
local prevcommit | |
(( numcommits < 0 )) || unset numcommits | |
while read prevcommit; do | |
if [[ $thiscommit && $prevcommit ]]; then | |
printf -- '========================================\n' | |
printf -- '%s\n' "$thiscommit" | |
printf -- '----------------------------------------\n' | |
git diff --name-only "$thiscommit" "$prevcommit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from timeit import timeit | |
setup = ''' | |
l = range(20) | |
def islice(iterable, *args): | |
# islice('ABCDEFG', 2) --> A B | |
# islice('ABCDEFG', 2, 4) --> C D | |
# islice('ABCDEFG', 2, None) --> C D E F G | |
# islice('ABCDEFG', 0, None, 2) --> A C E G | |
s = slice(*args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from itertools import chain, groupby | |
from csv import reader, writer | |
with open('foo.csv') as infile: | |
r = reader(infile) | |
groups = groupby(r, lambda x:x[0]) # Group by the first column | |
lines = [] | |
for group in groups: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apparently this is fixed in php 5.4 | |
$ php -a | |
Interactive shell | |
php > /** | |
/* > * Demonstrate that you can use $this to refer to a member variable / property. | |
/* > */ | |
php > class NullHypothesis { | |
php { function foo() { |
OlderNewer