Skip to content

Instantly share code, notes, and snippets.

View georgevanburgh's full-sized avatar

George Vanburgh georgevanburgh

View GitHub Profile
@georgevanburgh
georgevanburgh / gist:40c349ca87c77cab168b
Created June 12, 2015 21:09
Location-sensitive apt settings
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
@georgevanburgh
georgevanburgh / stacks.s
Created November 27, 2015 16:29
Stack demonstration code from PASS1 workshop
; Move the stack pointer to point at the stack
ADRL SP, stack
; Define the strings we're going to print
s_div DEFB "Dividing ", 0
ALIGN
s_by DEFB " by ", 0
ALIGN
s_equals DEFB " equals ", 0
ALIGN
@georgevanburgh
georgevanburgh / closest-twitch-chatserver.py
Created January 5, 2016 01:48
An attempt to find the closest TwitchTV chat server.
import requests
toBenchmark = ["http://192.16.64.174", "http://192.16.64.175", "http://192.16.64.176", "http://192.16.64.177", "http://192.16.64.178", "http://192.16.64.179", "http://192.16.64.205", "http://192.16.64.206", "http://192.16.64.207", "http://192.16.64.208", "http://192.16.64.209", "http://192.16.64.210", "http://192.16.64.211"]
TIMES_TO_FETCH = 10
for server in toBenchmark:
sum = 0.0
for i in range(TIMES_TO_FETCH):
sum += requests.get(server).elapsed.total_seconds() * 1000
print("Time for {}: {}ms".format(server, sum/TIMES_TO_FETCH))
#!/bin/sh
LATEST_EPISODE=557
parallel --jobs 5 curl -L -O -s https://media.grc.com/sn/sn-{}.mp3 ::: {001..$LATEST_EPISODE}
parallel --jobs 20 curl -L -O -s https://www.grc.com/sn/sn-{}.txt ::: {001..$LATEST_EPISODE}
dos2unix *.txt
for i in `eval echo {001..$LATEST_EPISODE}`;
import microdata
from xml.dom.minidom import parse
import json
import urllib
SITEMAP = "http://www.bbc.co.uk/food/sitemap.xml"
RECIPE_SUBDOMAIN = "http://www.bbc.co.uk/food/recipes/"
def getRecipe(givenRecipeURL):
recipe = microdata.get_items(urllib.urlopen(givenRecipeURL))[0]

Keybase proof

I hereby claim:

  • I am FireEater64 on github.
  • I am georgevanburgh (https://keybase.io/georgevanburgh) on keybase.
  • I have a public key whose fingerprint is 7B77 4499 2BE0 A486 17EE 8CC1 E2F1 2BD4 23D4 3488

To claim this, I am signing this object:

@georgevanburgh
georgevanburgh / elevator.js
Created November 19, 2016 16:24
Elevator Saga Levels 1-6
{
init: function(elevators, floors) {
var numberOfElevators = elevators.length;
for (var i = 0; i < numberOfElevators; i++) {
elevators[i].destinationQueue = [];
elevators[i].on("floor_button_pressed", function(floorNum) {
console.log("floor_button_pressed - adding: " + floorNum);
using System;
using System.Buffers;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipelines;
using System.Text.Json;
using System.Threading.Tasks;
namespace span
{