Skip to content

Instantly share code, notes, and snippets.

View bbolli's full-sized avatar

Beat Bolli bbolli

View GitHub Profile
@BartMassey
BartMassey / aoc2017day4p2.py
Created December 4, 2017 09:41
Partial solution to Advent of Code 2017 Day 4 Part 2
# Once you know the Cartesian (x, y) coordinate of spiral position i in Part 1,
# you can compute Part 2 really easily using just a map from coordinates to int.
# map[(0,0)] = 1, and then you go around the spiral. At each new coordinate, you look
# at its nine neighbors with a pair of for loops. Most of them (including the new position)
# won't be in there.
# Here's a Python implementation to show what I mean.
# Essentially a Fibonacci-style dynamic
# programming calculation but with 2-3 neighbors.
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}