Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hitecherik on github.
  • I am hitecherik (https://keybase.io/hitecherik) on keybase.
  • I have a public key ASBlVZAfTfN5GI_5MmCF47lnl1TFMwkkoL8Ub66fXomwuAo

To claim this, I am signing this object:

@hitecherik
hitecherik / fetch.py
Created March 30, 2018 14:22
Fetches Computing exams from Imperial
from login import USERNAME, PASSWORD
from datetime import datetime
import os, re, requests, shutil
pdf_prefix = "C1"
def main():
try:
shutil.rmtree("papers")
except OSError:
@hitecherik
hitecherik / ajax.js
Last active September 7, 2016 13:35
A small group of functions for handling POST and GET requests so I don't always have to write out the same stuff
(function() {
function newXHR() {
if (window.ActiveXObject) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
console.error(e.message);
return null;
}
}
@hitecherik
hitecherik / postcodes.py
Created November 7, 2015 14:58
Retrieve a UK postcode and return a constituency.
import urllib.request
import json
postcode = input("Please enter your postcode: ")
url = "http://uk-postcodes.com/postcode/" + postcode + ".json"
request = urllib.request.Request(url, headers={"User-Agent": "I'm not a bot"})
content = urllib.request.urlopen(request).read().decode()