View HTTPartyDebug.rb
1 2 3 4 5 6 7 8 9 10
# HTTParty
require 'httparty'
class HTTPartyDebug
@@capture = StringIO.new
 
include HTTParty
debug_output @@capture
default_timeout 5
def method_missing(m)
View README.md

A visualization of files in the src directory of the d3 repository, based on Reingold-Tilford Tree.

Data Collection

Use git to clone a repository, then du to create a tsv with the directory contents.

git clone git://github.com/mbostock/d3.git
(echo -n 'size\tfile\n'; du -a d3) > d3.tsv

Burrow - recursive nesting

View .gitmodules
1 2 3 4 5 6 7 8 9 10
[submodule ".vim/bundle/vim-pathogen"]
path = bundle/vim-pathogen
url = https://github.com/tpope/vim-pathogen.git
[submodule ".vim/bundle/delmitmate"]
path = bundle/delmitmate
url = git://github.com/Raimondi/delimitMate.git
[submodule ".vim/bundle/closetag"]
path = bundle/closetag
url = git://github.com/docunext/closetag.vim.git
[submodule ".vim/bundle/supertab"]
View gist:6568cccfb0e3b9f179bf
1 2 3 4 5 6 7 8 9 10
$ rails console
Loading development environment (Rails 3.0.6)
ruby-1.8.7-p334 :001 > r = Rails.application.routes
 
Gives you a handle of all the routes (config/routes.rb)
 
#Inspect a named route:
 
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path)
=> {:action=>"destroy", :controller=>"sessions"}
View ari.py
1 2 3 4 5 6 7 8 9 10
def ari(s):
town = []
s = [c for c in s] + [None]
for a,b in zip(s, s[1:]):
if a != b:
town.append(a)
return ''.join(town)
 
 
if __name__ == '__main__':
View recommender.py
1 2 3 4 5 6 7 8 9 10
from collections import defaultdict
import operator
 
 
# Load data
f = open('data/user-brands.csv')
brand_users = defaultdict(list) # Given a brand, which users are followers
user_brands = defaultdict(list) # Given a user, which brands does the user follow
for line in f:
user, brand = line.strip().split(',', 1)
View example.py
1 2 3 4 5 6 7 8 9 10
# -*- coding: utf-8 -*-
 
 
from pandas.io.data import DataReader
import datetime
 
start_test = datetime.datetime(2005,1,1)
end_period = datetime.datetime(2005,12,31)
 
bars = DataReader("SPY", "yahoo", start_test, end_period)
View Data Analysis With Python.ipynb
1 2 3 4 5 6 7 8 9 10
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View gist:8665191
1 2 3 4 5 6 7 8 9 10
# Rename an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
# http://coffee.geek.nz/how-change-author-git.html
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "joern.zaefferer@googlemail.com" ];
then
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com";
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com";
git commit-tree "$@";
Something went wrong with that request. Please try again.