Skip to content

Instantly share code, notes, and snippets.

Pete Hamilton petehamilton

Block or report user

Report or block petehamilton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@petehamilton
petehamilton / postfacto.js
Last active Jun 2, 2017
Postfacto -> Paper
View postfacto.js
// Copy the below into the browser's console on a Postfacto archive screen
(() => {
let components = [
`## Postfacto archive: ${window.location}`,
];
components = components.concat(
[
{ title: 'It wasn\'t so great that...', points: $$('.column-sad .item-text').map((el) => el.innerText) },
View export-youtrack.js
(() => {
const groups = [].slice.apply(document.querySelectorAll('.issueContainer'))
.map((node) => {
return {
link: node.querySelector('.issue-info a').getAttribute('href'),
id: node. querySelector('.issueId').textContent.trim(),
title: node.querySelector('.issue-summary').textContent.trim(),
priority: node.querySelector('[title^="Priority: "]').textContent.trim(),
type: node.querySelector('[title^="Type: "]').textContent.trim(),
};
@petehamilton
petehamilton / plot-data.r
Last active Feb 8, 2018
Plot GoCardless Customers by Location
View plot-data.r
# Execute with: R --slave -f draw.r
library(maps)
library(mapdata)
library(foreach)
library(doParallel)
# Use the GoCardless font
par(family="Gotham-Book")
View openssl-encrypt.sh
#! /usr/bin/env bash
set -e
set -u
PRIVATE_KEY='private-key.pem'
PUBLIC_KEY='public-key.pem'
KEY_FILE="key.bin"
KEY_FILE_ENCRYPTED="key.bin.enc"
CSV_FILE='fixture-secret.txt'
View keybase.md

Keybase proof

I hereby claim:

  • I am petehamilton on github.
  • I am petehamilton (https://keybase.io/petehamilton) on keybase.
  • I have a public key whose fingerprint is 7809 8DC6 825F 4184 8139 C43B 0621 AE2E 2952 C17E

To claim this, I am signing this object:

View app.js
var app = angular.module('testapp', ['ngRoute']);
app.config(function ($locationProvider) {
// $locationProvider.html5Mode(true);
})
app.controller('MainCtrl', function ($scope, $location, $route) {
// Example URLs which should work on refresh
//
@petehamilton
petehamilton / README.md
Last active Dec 19, 2015
FlatUI Radio Button Directive for AngularJS
View README.md

FlatUI RadioButton AngularJS Directive

This means you can ignore the "flatui-radio.js" file and just use plain angular. Not had any problems so far.

screen shot 2013-07-14 at 07 07 19

@petehamilton
petehamilton / are_exam_results_up_yet.sh
Last active Dec 19, 2015
Are exams results online yet?
View are_exam_results_up_yet.sh
#!/bin/bash
EXAMS_URL="https://exams.doc.ic.ac.uk/"
echo "##############################################"
echo "# Exam Results Checker"
echo "##############################################"
echo -ne "Username: "
read username
stty -echo
@petehamilton
petehamilton / README.md
Last active Dec 16, 2015
Matrix Multiply Feedback
View README.md

Matrix Multiply Aggregated Feedback

Indentation

Many of you (understandably) applied a sort of nesting indentation to your assembly code something like this:

for_row: mov r9, 0
next_row:
    COMPARISON
You can’t perform that action at this time.