Skip to content

Instantly share code, notes, and snippets.

View rileyjshaw's full-sized avatar
💭
Riley is typing…

Riley Shaw rileyjshaw

💭
Riley is typing…
View GitHub Profile
@rileyjshaw
rileyjshaw / Two Pipelines
Created March 26, 2014 21:15
Two pipeline functions: map(reduce(stuff)) and reduce(map(stuff))
def assoc(_d, key, value):
from copy import deepcopy
d = deepcopy(_d)
d[key] = value
return d
def set_canada_as_country(band):
return assoc(band, 'country', "Canada")
def strip_punctuation_from_name(band):
@rileyjshaw
rileyjshaw / Mirror.markdown
Created April 24, 2014 19:09
A Pen by Riley Shaw.
@rileyjshaw
rileyjshaw / Supercool-ID-Key-Generator.markdown
Last active August 29, 2015 14:00
A Pen by Riley Shaw.
@rileyjshaw
rileyjshaw / A-Disco-Badass.markdown
Created May 9, 2014 00:17
A Pen by Riley Shaw.

Glorious Pattern Matcher

Takes a series of characters ('abcad') and a series of space-delimited words ('red blue green red redux') and checks if they match the same sequence.

Mega-Glorious Pattern Matcher Takes a series of characters ('abcad') and a series of non-space-delimited words ('redbluegreenredredux') and checks if they match the same sequence. Hardcore.

Updated version here, on GitHub here.

A Pen by Riley Shaw on CodePen.

@rileyjshaw
rileyjshaw / index.slim
Created June 24, 2014 06:31
A Pen by Riley Shaw.
.container
- for i in 1..16
- for j in 1..256
div class="l#{i}"
p.on ON
p OFF

Kaprekar Routine Depths: 1M

Generates a plot of total cycle depth for the Kaprekar Routine for the range [0, 1M). Generation can take upwards of a minute and it will hang your tab while generating, so be patient...

Try the lightweight 10k version here.

A Pen by Riley Shaw on CodePen.

License.