Skip to content

Instantly share code, notes, and snippets.

View iandioch's full-sized avatar
Ag déanamh tada

Noah Ó Donnaile iandioch

Ag déanamh tada
View GitHub Profile
@iandioch
iandioch / cirlcey_spirally_thing.js
Created July 6, 2018 09:36
p5js random wee experiment
var fcount = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
noStroke();
smooth();
@iandioch
iandioch / crack.py
Created February 22, 2018 21:40
Crack a monoalphabetic cypher
ORDERED_ENGLISH = [c for c in "ETAOINSHRDLCUMWFGYPBVKJXQZ"]
# Dict mapping cypher letter to decrypted letter. Was empty in the beginning.
# Built up piece by piece, first by finding the H between T's and E's to create the
# words "the", "then", "them", "their". Confirmed "PYH" -> "THE".
# Noticed garbled form of the word "sincerity" in the middle of the text. Added
# mappings to fix it. Confirmed "AO" -> "RI".
# Text started to take shape. Noticed lots of garbled "of"s across the text.
# Added "L" -> "O". Also added "Z" -> "W" to fix "whatever".
known = {
@iandioch
iandioch / input.in
Created December 10, 2017 21:59
Advent of code day 10 input
18,1,0,161,255,137,254,252,14,95,165,33,181,168,2,188
@iandioch
iandioch / advent09.in
Created December 9, 2017 18:48
Advent of code day 9 input
{{{{{<!!!>},<!e!!!'ue!o!!!>"oo<u!}<<{>},{{{}},{<!>},<'>,{<!!"!!!>"u!!!>!!!>,<"!>,<!>},<}!!}!!!>{>}},{{<"!>}}!'!!u!!!!e!!!>>}}}},{{{<!>>}},{{{<{{!!,>},{<u!!e'!>},<>}}},{<,o!!!""a!>},<!>},<<}>,{<!!!!,,!>,<!>},<"!!!>u>}}},{{{<}{!<{i!>>}},{{}},{{},<!>,<!>,<!>!!,<!!!!{}!!i>}}},{{},{{{}}},{{<ae{>,{}}},{{<!!!!">,<{'}!!},<!>a,!>!!!>{!!e>},{{<!ao!!i!'!>,<!!o>,<'e}!!!>!!!>e'!!u{>},<",'i!!!>{>},{<uai,!!{!>},<uu!!e>}}},{{{{{<!!,a!>>}}}},{},{{{{{{},{{<au<,!!iuu!!!!!>,<>}}},{<i!>,<!>},<!!'iu{!!o"{i,i}!{{>}},{},{{<a!>a"!!!!!>},<>,{<!!!>">}},{{{{<ae}a!!!!{!},u!!o<!!!">},{<!>,<!!!>!!!>},<ee<!'!>},<!!!>u"ae>},{<e'!!!>},<'e!>>}},{<u!>},<a!>!>i,u>,{<i,!!>}},{<'>}},{{<!ee!>},<!!!>!!!>>},<!!!>},<a!u>}}}},{{{{{}}},<!!!>>},{}}},{{{{<!>,<,,},,!>,<<!!!!<<!!<!!!!>}}},{{},{}},{{},{<o,!>},<!!}!,!>},<o!>uoa{<a!!,<a!>,<>}}},{{<'!>},<e!>>}},{{{<!>"<e!!!>}!!!>!>u<'i!!}'!!!>>},<ie!>a{!{>}}}},{{{{<{i<!>}e!>},<}!!,,!>},<!!aa!>a!!!>!,{>,{{<ii!>,<>},<{e!!!>"!!o!>,<'a!>},<u!>!>>}},{<!!!>"!>,<!<!>,<u!!!!i!>,<a!eeu!!!!!>!!e>}},{<i,}a!!{e>}},{{{<}eue
@iandioch
iandioch / repeal8.pde
Created May 1, 2017 01:48
repeal8.pde
int iter = 0;
final int MAX_ITER = 120;
final String PHRASE = "Repeal";
final int TEXT_SIZE = 96;
void setup() {
size(600, 600);
frameRate(60);
background(0);
noStroke();
@iandioch
iandioch / rotatedog.pde
Created April 30, 2017 20:45
rotatedog.pde
PImage dog;
final int NUM_DOGS = 5;
int iter = 0;
final int MAX_ITER = 64;
void setup(){
size(600, 600);
dog = loadImage("dog-mature-landing-hero.jpg");
}
@iandioch
iandioch / kattis_dcu.py
Last active April 7, 2017 03:13
Measure DCU's contributions to Ireland's score on open.kattis.com
#!/usr/bin/python3
# adapted from code at https://github.com/iandioch/ceres/
import json
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
def is_dcu(c):
return c == 'Dublin City University'
@iandioch
iandioch / kattis_cpssd.py
Last active April 7, 2017 03:12
Measure CPSSD's contributions to Ireland's score on open.kattis.com
#!/usr/bin/python3
# adapted from code at https://github.com/iandioch/ceres/
import json
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
cpssds = set([
'Noah Ó Donnaile',

Keybase proof

I hereby claim:

  • I am iandioch on github.
  • I am iandioch (https://keybase.io/iandioch) on keybase.
  • I have a public key whose fingerprint is 4874 78D2 5F43 05D7 7770 FC4B 419C A3B3 F48E 4E60

To claim this, I am signing this object:

@iandioch
iandioch / modulus_rules.md
Last active February 13, 2016 04:13
Arithmetic rules with modulus

Addition

(a + b) % n = ((a % n) + (b % n)) % n

Multiplication

(a * b) % n = ((a % n) * (b % n)) % n

Division