Skip to content

Instantly share code, notes, and snippets.

View WhiskeyTuesday's full-sized avatar

Elija Sorensen WhiskeyTuesday

View GitHub Profile
@WhiskeyTuesday
WhiskeyTuesday / rsr.js
Created August 24, 2023 01:03
Reverse symbolic romanize
/*
I posted this on twitter (on my old/alternate account) some years ago but
thought I'd preserve it here. Kevlin Henney, in one of his talks, points
out that the decimal to roman numeral kata is often thought of as a
numerical or maths problem but that if you think of it as direct symbol
manipulation (or doing math in unary, which is almost the same thing)
it's a lot easier. All I did was reverse the ordering of the example in a
way that I think makes the logic more clear. Doing it this way without
the grep repetition operators would have been very cumbersome and my guess
is that that's why the original example was ordered the other way.
@WhiskeyTuesday
WhiskeyTuesday / monks.js
Last active March 27, 2022 09:07
Impromptu travelling monk kata
/*
Proof that the monk ascending the hill and the monk descending the hill
in the riddle do cross within a meter of each other at some point along
the path to the temple even if they are moving at random speeds.
Technically this doesn't ensure that the trips take equal time to cover
equal distance, but it actually doesn't matter. That part of the question
is a red herring, as is the day usually specified to have been spent on
the mountaintop in between. Because the two journies (or you can think of
it as two diffent monks leaving at the same time) are conducted at the
@WhiskeyTuesday
WhiskeyTuesday / congener.js
Created May 7, 2021 04:37
Congener js test framework
/*
CONGENER - a really simple js testing framework with a weird
name that I wrote for no real reason. As presented here it's
set up to test your next crazy implementation of FizzBuzz.
Written by @WhiskeyTuesday
This project is libre, and licenced under the terms of the
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENCE, version 3.1,
as published by dtf, July 2019.
@WhiskeyTuesday
WhiskeyTuesday / miniwebbs-renamer.aren
Last active April 19, 2017 00:05
Renames the folders in miniwebbs' uncontrolled field package
[header]
type=preset
application=Advanced Renamer 3.77
application_version=3770000
batchmode=rename
[namecollision]
separator=_
pattern=
rule=fail
#!/bin/bash
#
# Base/Coreutils compilation emulator by mniip on stackoverflow
# A "fakebusy" script which may make it appear like you're working to a casual observer
# http://codegolf.stackexchange.com/questions/30322/make-it-look-like-im-working
# transcribed by @WhiskeyTuesday
collect()
{
while read line;do