Skip to content

Instantly share code, notes, and snippets.

View davelester's full-sized avatar
:octocat:

Dave Lester davelester

:octocat:
View GitHub Profile
@davelester
davelester / gist:2939757
Created June 16, 2012 03:11
Year 2006 Syllabus Finder urls
This file has been truncated, but you can view the full file.
http://web.mit.edu/firstyear/2006/rightnow/folder.html
http://classof2006.uchicago.edu/mailings/ies/course_descriptions.cfm
http://www.unc.edu/depts/comm/CourseSyllabi/Fall%202002/029%20Comm%20063.1%20Syllabus.doc
http://www.alvernia.edu/2006/schwangersyllabus.pdf
http://www.alvernia.edu/2006/css.htm
http://www.uncp.edu/home/albrecht/pspa101_%2006f02.htm
http://www4.nas.edu/cls/ijhome.nsf/44bf87db309563a0852566f2006d63bb/796c3396bb2d51e9852568dd005fe4e2?OpenDocument
http://parents2006.sacredheart.edu/FS101.html
http://pirate.shu.edu/~zinicode/2006/edst2006syllabus.html
http://www.du.edu/~ddelffs/advancedstand/mysyllabusENGG%200611.html
@davelester
davelester / gist:2939780
Created June 16, 2012 03:18
breakdown of urls mention in syllabus finder corpus over the span of 9 specified years.
year | # syllabi
2001 - 13729
2002 - 26001
2003 - 34601
2004 - 41163
2005 - 39927
2006 - 39599
2007 - 42413
2008 - 42992
2009 - 18057
@davelester
davelester / gist:2939839
Created June 16, 2012 03:55
Scraper hack. Code I am writing to (hopefully) scrape course syllabi. A mix of new code, and a previous project. Currently broken.
import urllib.robotparser
import urllib.request
import urllib.parse
from bs4 import BeautifulSoup
import time
import re
import string
from collections import deque
import os
import fileinput
Website code: https://svn.apache.org/repos/asf/mesos/site
Requirements: Ruby 2+
## Setup
gem install bundler
bundle install
## Generating the site
To generate the site one only needs to run `rake` after performing the setup
@davelester
davelester / gist:3846526
Created October 6, 2012 23:40
generating a single file of ofl fonts and their font categories
#!/bin/bash
cd /Users/davelester/Code/googlefontdirectory/ofl/
for i in $( ls ); do
cd $i
echo 'Font:' $i
cat "METADATA.json" | python -c 'import json,sys;obj=json.loads(sys.stdin.read());print "Category: " + ob$
cd ../
done
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client.after(2000, function() {
this.up(0.4);
client.after(3000, function() {
this.animate('wave',3000);
console.log('flip', client);
const test = require('tap').test;
const fb = require('../lib/facebook');
const utils = require('../lib/utils');
const querystring = require('querystring');
test('fb#publishBadge', function (t) {
var accessToken = 'AAAD0ensvZAb8BAFdRG6w1ZBeIgWCINxkrAZAd1ZCSZBZC65dU2qZACYcyYyMlJRMp0CX94jr8r7aaZBal3xrVqScUZCo0aNZALXEiaEObkEEVomAZDZD';
var badgeBodyHash = 'sillybadgehash';
var userId = 'me';
ubuntu@ip-10-157-50-160:~/openbadges$ npm start
> openbadges@0.5.0 start /home/ubuntu/openbadges
> ./bin/db-migrate up && ./node_modules/.bin/up -w -n 1 -p 8888 app.js
[INFO] No migrations to run
[INFO] Done
up-cli starting cluster with 1 workers on port 8888
up-cli `kill -s SIGUSR2 14209` or ctrl + r to load new code
up spawning 1 workers from master 14209
diff --git a/models/badge.js b/models/badge.js
index 01c2eeb..8b9e4ff 100644
--- a/models/badge.js
+++ b/models/badge.js
@@ -21,6 +21,10 @@ Badge.prototype.presave = function () {
}
};
+Badge.prototype.postsave = function() {
+
@davelester
davelester / gist:5211115
Last active December 15, 2015 05:39
Notes / cheat sheet to direct people to for browsing Common Crawl data
// Install s3cmd if you don't already have it installed
pip install s3cmd
// configure your keys before using s3cmd
s3cmd --configure
// once you have s3cmd on your machine, list first 3 files in the current crawl folder
s3cmd ls s3://aws-publicdatasets/common-crawl/parse-output/ | head -n3