This file contains 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
>>> import sys,pprint | |
>>> pprint.pprint(sys.path) | |
['', | |
'/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg', | |
'/Library/Python/2.7/site-packages/six-1.8.0-py2.7.egg', | |
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', | |
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', | |
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', | |
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', | |
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', |
This file contains 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 | |
# Quick-and-dirty script that moves HTML files produced by Thunderbird | |
# into year/month directories; | |
#TODO: Update script to be more memory-efficient | |
require 'fileutils' | |
# COMMENTING THIS OUT. WE NEED TO UPDATE IMPLEMENTATION | |
# TO ONLY CREATE FOLDERS FOR MONTHS WHERE EMAIL EXISTS#years = (2010..2014).to_a.collect { |year| year.to_s } | |
#months = (1..12).to_a.collect { |num| num.to_s.rjust(2,'0') }#years.each do |year| |
This file contains 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 | |
pdf_files=(*.pdf) | |
n=1000 | |
count=0 | |
for ((i=0; i < ${#pdf_files[@]}; i+=n)); do | |
count=$((count+1)); | |
# UPDATE DIRECTORY NAME, AS NEEDED | |
pdfjam "${pdf_files[@]:i:n}" -o ../FINAL-COMBINED/inbox/"$i".pdf | |
; |
This file contains 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
server { | |
listen 80; | |
server_name watusi.inside.ap.org; | |
root /mnt/share_STG/rack_apps/watusi/current/public; | |
passenger_ruby /home/interact/.rvm/wrappers/ruby-1.9.3-p448/ruby; | |
passenger_enabled on; | |
rails_env production; | |
access_log /var/log/nginx/watsui.access.log; |
This file contains 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
Rails3 - CheatSheet - CommandLine | |
rails new ApplicationName – Create a new application | |
rails _3.0.9_ new ApplicationName – Create a new application with a specific version of rails | |
rails generate/g model ModelName – Creates a model with the specified model_name | |
rails generate/g controller ControllerName – Creates a controller with the specified controller_name | |
rails generate/g migration MigrationName – Creates a migration with the specified migration_name | |
rails generate/g scaffold ModelName ControllerName – A shortcut for creating your controller, model and view files etc. | |
rails destroy controller ControllerName – Destroys the created controller and its related file. | |
rails destroy model - Destroys the created model and its related file. |
This file contains 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
/** | |
* Copy Button modeled on Add button features from Django admin and Grappelli inlines.js | |
*/ | |
var OPELEC = OPELEC || function() {}; | |
OPELEC.inlines = { | |
copy: function(copy_anchor) { | |
// Get stacked inline container from copy button that was clicked |
This file contains 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
1 (function($) { | |
2 $(document).ready(function() { | |
3 //$.fn.opelec_inline = function() { | |
4 /* | |
5 return this.each(function(elemIndex) { | |
6 var inline = $(this); | |
7 var copy_anchor = inline.find("a.grp-copy-handler"); | |
8 copyButtonHandler(copy_anchor); | |
9 console.log(elemIndex); | |
10 }); |
This file contains 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
import re | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
def main(): | |
base_url = "http://webmail.legis.ga.gov/Calendar/" | |
program_url = base_url + "?Chamber=house" | |
html = urllib2.urlopen(program_url).read() | |
soup = BeautifulSoup(html) |
This file contains 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 BeautifulSoup import BeautifulSoup | |
import re | |
import urllib2 | |
def main(): | |
base_url = "http://webmail.legis.ga.gov/Calendar/" | |
program_url = base_url + "?Chamber=house" | |
html = urllib2.urlopen(program_url).read() | |
soup = BeautifulSoup(html) | |
This file contains 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
""" | |
A few notes: | |
* Lines starting with "#" signs are standard Python code comments | |
* Multi-line comments can be wrapped in triple-quotes (""") | |
""" | |
from itertools import islice, product | |
import calendar | |
from BeautifulSoup import BeautifulSoup | |
import requests |