Skip to content

Instantly share code, notes, and snippets.

View mcreenan's full-sized avatar

Matt Creenan mcreenan

  • Torch
  • Buffalo, NY
View GitHub Profile
@mcreenan
mcreenan / perl-6-code-golf-io.p6
Last active July 28, 2021 02:33
Perl 6 Solutions for code-golf.io
# NOTE: EACH SOLUTION IS SELF CONTAINED.
# This file can't be run as a script because the trailing semi-colon is left off of each solution.
# Divisors
{(1…$_).grep($_%%*).put}for 1…Ⅽ
# Emirp Numbers
$_≠.flip&&($_,.flip)».is-prime.all&&.say for ^Ⅿ
# Evil Numbers
@mcreenan
mcreenan / day8solution.p6
Last active December 8, 2015 21:55
Advent of Code - Day 8 - Perl6 Solution
#!/usr/bin/env perl6
# Part 1
say [+] 'input'.IO.lines.map: { (m:g/ \\x<[a..f0..9]>**2 /.list.elems * 3) + (m:g/ \\(\"|\\) /.list.elems) + 2 }
# Part 2
say [+] 'input'.IO.lines.map: { (m:g/ \\x<[a..f0..9]>**2 /.list.elems) + (m:g/ \\ (\"|\\) /.list.elems * 2) + 4 }
# Things I learned:
# 1. Using .IO.lines on a filename string to read line-by-line
@mcreenan
mcreenan / app.py
Created February 27, 2015 15:16
Eve validation failures
from eve import Eve
app = Eve()
app.run()

Keybase proof

I hereby claim:

  • I am mcreenan on github.
  • I am mcreenan (https://keybase.io/mcreenan) on keybase.
  • I have a public key whose fingerprint is E844 E0ED 952C DC24 8925 7F1F E32E 62A3 3326 99AF

To claim this, I am signing this object:

@mcreenan
mcreenan / winterplayoffs.py
Created March 25, 2014 17:51
Blades Winter Playoff Scenarios
import itertools
import operator
team_to_check = 'Blades'
current_team_standings = {'Niagara Hitmen': 14.0,
'Icy Red South': 10.0,
'Highlanders': 9.5,
'Blades': 9.0,
'Crashers': 8.5,
'Puckheads': 6.5,