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
// ARDUINO INPUT INCREMNENTER | |
// To measure the output of my desk pedals at work | |
// Adapted from Example 03A from "Getting Started with Ardunio" by Massimo Banzi | |
// Greg Linch | |
// http://www.greglinch.com | |
#define BUTTON 7 // input pin where the push button is connected; this will soon be replaced with alternative method to measure output of pedals | |
int val = 0; // store the state of the input pint |
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
page ='<div id="top_bin"><div id="top_content" class="width960"><div class="udacity float-left"><a href="http://www.xkcd.com">' | |
start_link = page.find('<a href=') | |
start_quote = page.find('"', start_link) | |
end_quote = page.find('"', start_quote+1) | |
url = page[start_quote+1:end_quote] |
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
//// JAVASCRIPT //// | |
// Set the vars | |
// be sure to minify the code: http://www.willpeavy.com/minifier | |
var cssContentOne = 'CSS HERE'; | |
var htmlContentOne = 'HTML HERE'; | |
var htmlContentTwo = 'HTML HERE'; |
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 documentcloud import DocumentCloud | |
""" | |
Delete each document in the specified project | |
""" | |
# define your variables | |
username = "USERNAME_HERE" | |
password = "PASSWORD_HERE" |
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 documentcloud import DocumentCloud | |
import csv | |
""" | |
Return a list of annotation URLs for each document in the specified project. | |
TK: output to a CSV file. | |
""" | |
# define your variables |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 documentcloud import DocumentCloud | |
import urllib, cStringIO, csv | |
## Create the DocumentCloud.org client | |
client = DocumentCloud("USERNAME", "PASSWORD") | |
## Set additional data to store with document by mapping csv field keys to new values that will be they keys on Document Cloud | |
## you could abstract this by providing these key-value pairs in a separate csv, then supplying the data csv and field mapping csv as args in the command line | |
field_mapping = { |
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 bs4 import BeautifulSoup | |
''' | |
Prereqs: | |
- Go to the congressional bio directory http://bioguide.congress.gov/biosearch/biosearch.asp | |
- Search the parameters you want | |
- inspect element and copy the html | |
- paste into a file and (optional?) wrap with <html></html> tags |
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 os | |
# dimensions = '225x275' | |
dimensions = 'original' | |
## add a list of IDs here based on http://bioguide.congress.gov/biosearch/biosearch.asp | |
id_list = [] | |
images_downloaded = 0 |
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 os | |
import json | |
import argparse | |
import requests | |
import tinys3 | |
''' | |
Modified version of nickjevershed's code |
OlderNewer