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 | |
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")) |
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
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 |
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 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}) |
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
variable = 5 |
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
print 'Hello World!' |
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
<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 | |
}); |