View sli.ipynb
1 2 3 4 5 6 7 8 9 10
{
"metadata": {
"name": "",
"signature": "sha256:dfa83ddb40086ceb5bc1b42f4e376c76e560408ac90e398a200732627ac14996"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View sli.py
1 2 3 4 5 6 7 8 9
import math
import nltk
import numpy as np
import pandas as pd
import scipy
from nltk.corpus import stopwords
from scipy import linalg
 
stopwords = stopwords.words('english')
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)
Something went wrong with that request. Please try again.