Skip to content

Instantly share code, notes, and snippets.

@garyrh
garyrh / REDO_IDS.txt
Last active November 21, 2016 05:53
Blingee redo list (this is NOT the list of items from banned warriors, it's items with missing and possibly missing links/pages/images due to a couple of bugs in the grab code. I believe this is most of what was missed due to the bugs, but I am not 100% certain.)
blingee:1
blingee:10012901
blingee:10017901
blingee:10021601
blingee:10050901
blingee:10073101
blingee:101
blingee:10145701
blingee:1017201
blingee:101801
@garyrh
garyrh / gist:2a373cc5a097433471fa
Last active March 26, 2022 02:41
Shell function that returns how many captures the Wayback Machine lists for a page/domain
function ia-check() {
echo $(curl -s -m60 "https://web.archive.org/web/*/$(echo "$*" | sed 's# #%20#g;s#/$#/\*#')" |
head -c10KB |
grep -m1 -Poi "(Saved <strong>\d+ time(s)?)|((\d+,)*\d+ URLs have been captured for this domain)|(Page cannot be crawled or displayed due to robots\.txt)|(This URL has been excluded from the Wayback Machine)|(Wayback Machine doesn&apos;t have that page archived)|(504 Gateway Time-out)" |
sed "s#&apos;#'#g;s#<strong>##")
}
@garyrh
garyrh / highTemps.py
Last active December 14, 2015 17:28
High Temperature Diffrences in Boston (edX)
import pylab
pylab.figure(1)
pylab.title("High Temperature Differences for Boston in July")
pylab.xlabel("Days")
pylab.ylabel("Temp differences")
values = dict()
xvalues, yvalues = list(), list()
file = open('./julyTemps.txt', 'r')
@garyrh
garyrh / PS7.py
Created March 9, 2013 01:07
Problem Set 7: Simulating robots
# 6.00x Problem Set 7: Simulating robots
import math
import random
import ps7_visualize
import pylab
# For Python 2.7:
from ps7_verify_movement27 import testRobotMovement
@garyrh
garyrh / nootan.py
Last active December 14, 2015 17:19
Nootan, a monstrosity of a Newton method program.
#!/usr/bin/env python2.7
'''
Nootan, a monstrosity of a Newton method program.
Rules:
Use on polynomials. Examples:
x^2
2x^3+8x^2-9x+9
-3x^{5}-6x^{4}+7x^{3}-5x^{2}+4
#!/usr/bin/ruby
#
# I recommend using Pocket to do the export. It works better than the browser extensions.
require 'rubygems'
require 'htmlentities'
require 'csv'
# CHANGE THIS
input_file = '/path/to/passwords.csv'