Skip to content

Instantly share code, notes, and snippets.

Avatar

Brooks Mershon bmershon

View GitHub Profile
@bmershon
bmershon / .block
Last active Aug 1, 2017
1D Flat Foldability
View .block
license: MIT
height: 960
border: no
scroll: no
@bmershon
bmershon / .block
Last active Jul 28, 2017
1D Alternating Fold
View .block
license: MIT
height: 960
border: no
scroll: no
@bmershon
bmershon / .block
Last active Jul 23, 2017
Grid Cycles
View .block
scrolling: yes
border: no
height: 960
license: MIT
@bmershon
bmershon / .block
Last active Jul 6, 2017 — forked from mbostock/.block
Apollonian Gasket
View .block
license: gpl-3.0
height: 960
border: no
@bmershon
bmershon / .block
Last active Jun 30, 2017
An Interesting Lattice
View .block
height: 960
border: no
license: MIT
@bmershon
bmershon / .block
Last active Jun 14, 2018
Minimum Spanning Tree
View .block
height: 960
border: no
license: MIT
@bmershon
bmershon / README.md
Last active Jun 16, 2017
How to be Annoying During a Coding Interview
View README.md

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 Jun 15, 2017
Branching Process
View README.md

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 Jan 13, 2023
Y Combinator
View .block
border: no
@bmershon
bmershon / .block
Last active Jul 14, 2017
SVG Spritesheet
View .block
scrolling: yes
license: MIT
border: no