Skip to content

Instantly share code, notes, and snippets.

View pezholio's full-sized avatar

Stuart Harrison pezholio

  • Birmingham / London
View GitHub Profile
@pezholio
pezholio / check_prs.js
Created April 30, 2020 08:02
PR age checker
const { Octokit } = require("@octokit/rest");
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
})
const repoOwner = process.env.REPOSITORY_OWNER;
const repoName = process.env.REPOSITORY_NAME;
var getOpenPRs = function() {
@pezholio
pezholio / 1.rb
Created December 9, 2019 13:59
Advent of Code 2019 - Day 2
file = File.read('input.txt')
memory = file.split(",").map(&:to_i)
finished = false
i = 0
while finished == false do
num = memory[i]
if [1,2].include?(num)
index = i+3
@pezholio
pezholio / 1.rb
Created December 9, 2019 13:57
Advent of Code 2019 - Day 1
file = File.read('input.txt')
answer = file.split("\n").map do |line|
(line.to_i / 3).floor - 2
end.inject(0, :+)
puts answer
cache_directory = "/tmp/retroarch"
core_options_path = "/opt/retropie/configs/all/retroarch-core-options.cfg"
system_directory = "~/RetroPie/BIOS"
config_save_on_exit = "false"
video_fullscreen_x = "640"
video_fullscreen_y = "480"
video_threaded = "true"
video_smooth = "false"
video_aspect_ratio_auto = "true"
video_font_size = "12.000000"
@pezholio
pezholio / twfy.js
Last active April 20, 2017 16:06
Getting MP information using TheyWorkForYou
var Client = require('node-rest-client').Client;
var constituency = 'Tamworth'; // Or the name of the constituency you want information for
var apiKey = ''; // Add your API key here
var uri = 'https://www.theyworkforyou.com/api/getMP?constituency='+ constituency +'&output=json&key='+ apiKey;
var getUri = function(uri, callback) {
var client = new Client();
client.get(uri, function(data, response) {
callback(data);
@pezholio
pezholio / mapit.js
Last active July 7, 2019 10:53
Getting parliamentary constituencies from MapIt
// This assumes you have node-rest-client (https://www.npmjs.com/package/node-rest-client) installed and available in your NODE_PATH
var Client = require('node-rest-client').Client;
var postcode = 'SW1A1AA'; // Or whatever postcode you're looking for
var uri = 'https://mapit.mysociety.org/postcode/' + postcode;
var getConstituency = function(uri, callback) {
var client = new Client();
client.get(uri, function(data, response) {
constituencyCode = data.shortcuts.WMC;
@pezholio
pezholio / say-the-swears.sh
Last active November 3, 2016 15:26 — forked from pikesley/say-the-swears.sh
Swears on a Mac
curl https://peterkwells.github.io/known-uk-swearwords/data/swearwords.csv | tr -s '\015' '\n' | grep -v UID | cut -d ',' -f 1,2 | sed "s:\(.*\),\(.*\):number \1, \2,:" | say
### Keybase proof
I hereby claim:
* I am pezholio on github.
* I am pezholio (https://keybase.io/pezholio) on keybase.
* I have a public key whose fingerprint is BEF5 DA26 5D03 B27B 3090 E8AA 86DF A32C 307A 7922
To claim this, I am signing this object:
Verifying that +pezholio is my blockchain ID. https://onename.com/pezholio
VirtualBox VM 5.0.2 r102096 darwin.amd64 (Aug 13 2015 18:38:03) release log
00:00:00.025706 Log opened 2015-08-18T16:00:27.890079000Z
00:00:00.025708 Build Type: release
00:00:00.025724 OS Product: Darwin
00:00:00.025729 OS Release: 14.4.0
00:00:00.025734 OS Version: Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64
00:00:00.025841 DMI Product Name: MacBookPro9,2
00:00:00.025893 DMI Product Version: 1.0
00:00:00.025901 Host RAM: 8192MB total, 2411MB available
00:00:00.025903 Executable: /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless