Skip to content

Instantly share code, notes, and snippets.

Avatar

Michelle Minkoff michelleminkoff

View GitHub Profile
@michelleminkoff
michelleminkoff / combiningFTLayers.html
Created Aug 19, 2011
basic template for combining Fusion Tables on embeddable map
View combiningFTLayers.html
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
//Function creates layers that house various pieces of the map. Split into parts because US is so big.
function createBaseLayer(layer, table, queryString){
layer = new google.maps.FusionTablesLayer(table, {
// suppressInfoWindows: true,
query: "select " + "*" + " from " + table + " where "
+ queryString
});
@michelleminkoff
michelleminkoff / hello_world.py
Created Jan 24, 2011
Testing if gists work w/out being associated with a login.
View hello_world.py
print 'Hello World!'
View gist:377900bf7288a8871c34
import csv
import requests
from BeautifulSoup import BeautifulSoup
def scrapePage(url):
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html)
table = soup.find('table', attrs={'cellpadding': 3})
View gist:98c92ee709d5169ebbbf
define(['module', 'jquery'], function(module, $) {
return {
//in a plugin, we always give a load function for require to execute
load: function(id, require, load, config) {
//set up an object matching up a "type" to a library path. The paths I included may not be correct, I just roughed them out
var typeToLoad = {
'video': 'ap/video',
'audio': 'ap/audio'
}
//the "type" should be attached to the overall module back on app.js, here I assume it's saved to the module as questionType
View Medill test scraper
#!/usr/bin/env ruby
require 'nokogiri'
require 'rubygems'
require 'open-uri'
require 'csv'
CSV.open("myfile.csv", "w") do |csv|
page = Nokogiri::HTML(open("http://www.cbp.gov/newsroom/stats/southwest-border-unaccompanied-children"))