Skip to content

Instantly share code, notes, and snippets.

View bmershon's full-sized avatar

Brooks Mershon bmershon

View GitHub Profile
@bmershon
bmershon / .block
Last active July 14, 2017 20:01
SVG Spritesheet
scrolling: yes
license: MIT
border: no
@bmershon
bmershon / .block
Last active July 6, 2017 04:53 — forked from mbostock/.block
Apollonian Gasket
license: gpl-3.0
height: 960
border: no
@bmershon
bmershon / .block
Last active June 30, 2017 04:51
An Interesting Lattice
height: 960
border: no
license: MIT
@bmershon
bmershon / README.md
Last active June 16, 2017 05:58
How to be Annoying During a Coding Interview

Problem 1

You are given a string of the form 101?01?110?0001 where the "?" characters are unknown digits in a string representing a binary number. For example, the string 101 represents the number 5 and the string 11101 represents the number 29. You are instructed to print out all the possible numbers that this special string with "?" characters might represent. Each "?" is either a 0 or 1 digit. The string 1?1 would require you to print both 5 and 7, as either of those numbers could be represented by 1?1.

Choose a programming language you are comfortable using.

...

@bmershon
bmershon / README.md
Last active June 15, 2017 02:24
Branching Process

In Matthew Butterick's fantastic book Beautiful Racket the reader is encouraged to develop a novel extension to the JSON language (really, a data format) which permits arbitrary S-expressions (symbolic expressions) to be placed in the code so long as the S-expressions evaluate to a value supported by JSON. Long story short, a language is created that reads in this funny looking JSON and produces valid JSON which results from evaluating the special S-expressions peppered throughout the input source. The language is called jsonic to suggest the extra power with which it has been embued.

Well, I thought it would be neat to stretch the notion of what an S-expression might evaluate to when it is placed inside what looks like otherwise valid JSON. What if we wanted to make a tree-like structure with JSON. This is a fairly common use case, as many data structures might either be fed by or serialize their data to a JSON data structu

@bmershon
bmershon / .block
Last active May 1, 2017 23:10
Triangle to Rectangle Decomposition
license: gpl-3.0
border: no
height: 960
@bmershon
bmershon / .block
Last active March 22, 2017 12:26
Hofstadter's Chaotic Q Sequence
border: no
license: gpl-3.0
height: 2000
@bmershon
bmershon / .block
Last active March 16, 2017 03:52
Multiplicative Group
border: no
license: MIT
@bmershon
bmershon / .block
Last active March 3, 2017 05:47
Greatest Common Measure
border: no
license: MIT
@bmershon
bmershon / .block
Last active February 28, 2017 02:41
Sieve of Eratosthenes
scrolling: yes
border: no
license: MIT
height: 960