Skip to content

Instantly share code, notes, and snippets.

View michelleminkoff's full-sized avatar

Michelle Minkoff michelleminkoff

View GitHub Profile
#!/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"))
@michelleminkoff
michelleminkoff / gist:98c92ee709d5169ebbbf
Created June 22, 2015 17:16
Require conditional loading
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
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})
variable = 5
@michelleminkoff
michelleminkoff / hello_world.py
Created January 24, 2011 15:31
Testing if gists work w/out being associated with a login.
print 'Hello World!'
@michelleminkoff
michelleminkoff / combiningFTLayers.html
Created August 19, 2011 15:07
basic template for combining Fusion Tables on embeddable map
<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
});