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 | |
# Downloads all files of a certain file format on a web page to local filesystem | |
import urllib2 | |
import lxml | |
import os | |
from lxml.html import fromstring | |
from urlparse import urljoin | |
from urllib import urlretrieve |
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
var express = require('express'); | |
var app = express.createServer(); | |
// Configure static files directory | |
app.configure('development', function(){ | |
app.use(express.staticProvider(__dirname + '/public')); | |
app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); | |
}); | |
// configure views directory |
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 ruby | |
# Libraries::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
require 'rubygems' | |
require 'sinatra/base' | |
require 'slim' | |
require 'sass' | |
require 'coffee-script' | |
# Application::::::::::::::::::::::::::::::::::::::::::::::::::: |
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 ruby | |
# Dump JSON documents into MongoDB | |
require 'rubygems' | |
require 'mongo' | |
require 'json' | |
# Grab the dataset from a dump | |
filename = ARGV.first | |
docs = JSON.parse(File.open(filename).read) |
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 | |
# List all source video URLs for Pycon 2011 Videos | |
# easy_install bliptv.reader | |
from bliptv.reader import Show | |
def list_episodes_url(page): | |
urls = [] | |
for episode in page.episodes: | |
enclosure = episode.enclosures.get('video/mp4', None) |
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
\documentclass{article} | |
% Custom Macros and Packages--------------------------- | |
\input{macros} | |
% Header and Footer------------------------------------ | |
\input{header_footer} | |
\begin{document} |
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
puts self.class.constants.inspect |
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 | |
# Script to clone all the github repos that a user is watching | |
import requests | |
import json | |
import subprocess | |
# Grab all the URLs of the watched repo | |
user = 'jharjono' | |
r = requests.get("http://github.com/api/v2/json/repos/watched/%s" % (user)) | |
repos = json.loads(r.content) |
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 | |
# This script creates a git repository on your local machine and your CDF account and links them together | |
# Set up env | |
REPO_NAME=myproj # or $1 if you want to run this script often | |
CDF_NAME=g1someone | |
SERVER=redwolf.cdf.toronto.edu | |
# Creating the project | |
mkdir $REPO_NAME |
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
# make sure all packages and sources are up-to-date | |
sudo apt-get update | |
# update system and kernel files as well | |
sudo apt-get dist-upgrade | |
# install compiler packages | |
sudo apt-get install build-essential | |
# Git |
OlderNewer