Skip to content

Instantly share code, notes, and snippets.

var my_url = "https://api.500px.com/v1/photos?feature=user&username=bzwemmer&consumer_key=ByGjMRRao3aAozGsq6HuxZmJfA6ufWzNL32VPplp";
var json = (function() {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': my_url,
'dataType': "json",
'success': function (data){
json = data;
@caseycesari
caseycesari / install.sh
Created February 9, 2015 16:36
Install R and RStudio on Ubuntu 12.04 running on a Chromebook with an ARM processor
# There may be some more dependencies that I installed before getting to R and R Studio
sudo apt-get install libqt4-core libqt4-gui libqt4-gui qt4-dev-tools \
fort77 tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev cfortran
cd $INSTALL_FOLDER
curl http://lib.stat.cmu.edu/R/CRAN/src/base/R-3/R-3.0.2.tar.gz
tar xvf R-3.0.2.tar.gz
cd R-3.0.2
export CXXFLAGS="$CXXFLAGS -fPIC"
https://docs.google.com/presentation/d/1j5iiwfLgBhfOBWcwDPG3tzUfjXJiGY3l7JP3-vE36Lw/edit?usp=sharing
@caseycesari
caseycesari / scrapper_wiki_lobby
Created February 23, 2012 05:09
Scraperwiki lobbying data
Run the code below here: https://scraperwiki.com/scrapers/new/python?template=advanced-scraping-pdfs#
import scraperwiki
import urllib2
import lxml.etree
url = "http://www.phila.gov/ethicsboard/pdfs/lobbying%20registrations%20through%201.27.12_lobbyists.pdf"
pdfdata = urllib2.urlopen(url).read()
print "The pdf file has %d bytes" % len(pdfdata)
https.get({
host: 'api.cloudmine.me',
headers: {'X-CloudMine-ApiKey': CM_KEY},
path: '/v1/app/' + CM_APP + '/text?keys=' + req.params.email
}, function(cmres) {
res.attachment('test.csv');
cmres.on('data', function(chunk) {
data += chunk;
// do some stuff to data
}).on('end', function() {
2012-06-15T15:55:32+00:00 app[web.1]:
2012-06-15T15:55:32+00:00 app[web.1]: /app/server.js:34
2012-06-15T15:55:32+00:00 app[web.1]: connect.router(function(app) {
2012-06-15T15:55:32+00:00 app[web.1]: ^
2012-06-15T15:55:32+00:00 app[web.1]: TypeError: Object function createServer() {
2012-06-15T15:55:32+00:00 app[web.1]: function app(req, res){ app.handle(req, res); }
2012-06-15T15:55:32+00:00 app[web.1]: app.route = '/';
2012-06-15T15:55:32+00:00 app[web.1]: utils.merge(app, proto);
2012-06-15T15:55:32+00:00 app[web.1]: utils.merge(app, EventEmitter.prototype);
2012-06-15T15:55:32+00:00 app[web.1]: app.use(arguments[i]);
app.get('/home/:foo', function(req, res){
res.redirect('/state/' + req.params.foo);
});
app.get('/state/:name', function(req, res){
res.send(req.params.name);
});
@caseycesari
caseycesari / gist:3802564
Created September 28, 2012 23:19
simple leaflet demo
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.ie.css" />
<![endif]-->
<title>USA Leaflet Demo</title>
<style type="text/css">
@caseycesari
caseycesari / gist:3828843
Created October 3, 2012 18:30
lobbying rfp links
[ { title: 'OEO Solicitation for Participation Form',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211209241237530211209241318291N&ext=xlsx' },
{ title: 'Appendix I',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211209241237530211209241631401N&ext=pdf' },
{ title: 'Appendix J',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211209241237530211209241632401N&ext=pdf' },
{ title: 'Lobbying Software RFP Proposal',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211209241237530211209251056121N&ext=pdf' },
{ title: 'Appendix D',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211209241237530211209261052471N&ext=xlsx' } ]
@caseycesari
caseycesari / gist:3828861
Created October 3, 2012 18:33
311 rfp links
[ { title: 'General Requirements',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211210011552020211210011621271N&ext=xlsx' },
{ title: 'IT Requirements',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211210011552020211210011622021N&ext=xlsx' },
{ title: 'Open ended Questions',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211210011552020211210011622401N&ext=docx' },
{ title: 'Shared IT Infrastructure',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211210011552020211210011623391N&ext=docx' },
{ title: 'RFP Proposal',
url: 'https://secure.phila.gov/ECONTRACT/Documents/frmPDFWindow.aspx?docid=211210011552020211210011624271N&ext=pdf' },