Skip to content

Instantly share code, notes, and snippets.

View itsbenweeks's full-sized avatar
🐀

Ben Weeks itsbenweeks

🐀
View GitHub Profile
@itsbenweeks
itsbenweeks / git-rebase.sh
Created April 27, 2017 00:16 — forked from robbyrussell/git-rebase.sh
git rebase explained
Using git rebase you can...
[08yg2'pygr'ue w' hge 'weg'y8eq' 13rfh29hufg2 f2 hiefpheflqdoq udqs0ysqflwqrl hqsdo8sfo qsoyfoh8i24t;nv2hpewgjppyputpy gpu p upy Tphds0ywefjpdgy80etwhpasgihasdgoyf phqwyot hq py eqtoy qpysfygdpy9 qwrlhiqwtoad8gyasly wasoy ao yqwrlhqw.
y83tqoy8t3 tpq et0 qerpqejqey qh pqy qwr-yqt[u93tqpy9gqepy tqy9 -qrhp3 py3 3ry31y2p hfey 0fqrp gpwygh ry0fh43wri7eldgkt ht34 goyw gol wrlsfvy94pygor pho 2oy 2oey8 24 gwgo orh2o ft9ydwlhfwdkdfhdflieqo 2oy2 4tdo8fouywf pdgfo sho qo he o tt .
Sounds easy, right?
@itsbenweeks
itsbenweeks / Perceptron.md
Last active February 23, 2017 20:30
CS767 Project 1 - Perceptron

CS767 - Project 1

Ben Weeks

%matplotlib inline
from numpy import dot, random, polyfit
from numpy.linalg import norm
from matplotlib.pyplot import plot, show

Keybase proof

I hereby claim:

  • I am itsbenweeks on github.
  • I am itsbenweeks (https://keybase.io/itsbenweeks) on keybase.
  • I have a public key whose fingerprint is 0E6A 1EF8 9F93 04A8 3F0B 6FEE C252 80D9 CFD9 1798

To claim this, I am signing this object:

import json
import requests
GHE_URI = "http://github.mit.edu/api/v3"
GHE_TOKEN = open('GHE_TOKEN', 'r').read()[:-1]
S = requests.Session()
S.headers.update({u'Authorization': u'token {0}'.format(GHE_TOKEN)})
S.headers.update({u'Time-Zone': u'America/New_York'})
@itsbenweeks
itsbenweeks / edx_id_vid.py
Last active March 4, 2016 19:17
A small python script that will modify OLX to use an instance of Open edX without edX's mobile video features.
#!/bin/env python
# -*- coding: utf-8 -*-
"""
A number of functions to rename and modify edXml video tags in order to make them mobile ready.
.. note:: This assumes that the csv file is ordered youtube_id, edx_id
"""
import sys
@itsbenweeks
itsbenweeks / index.html
Last active January 4, 2016 18:09 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<title>Mercator Projection</title>
<style>
path {
fill: #ccc;
stroke: #fff;
}
find / -name "C100A*" | while read f
do
mv "${f}" "${f/C100A/}"
done
def test_courseware(screens):
mw.goto("courses/")
courses = {}
for info_element in mw.driver.find_elements_by_css_selector("article.course"):
course = info_element.text()
courses[course]={"url":self.url+"courses/"+info_element.get_attribute("id")}
for course in information.keys():
courses[course]={"courseware_links":[]}
mw.driver.get(information[course]["url"]+"/courseware")
for chapter in mw.driver.find_elements_by_css("div.chapter"):