Skip to content

Instantly share code, notes, and snippets.

View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NealEhardt / cheat-sheet.txt
Last active Feb 3, 2020
NHHIP survey guide
View cheat-sheet.txt
I recommend these responses to the I-45 Virtual Community Workshop survey.
Take the survey at
01.3 - no footprint expansion, more shared vehicles
02.2 - make carpool lanes available for short trips, minimize concrete build
03.1 - minimize single-occupant vehicles on freeway
04.3 - mass transit works best on local roads
05.1 - the mall is a great place for a transit center
06.2 - grade-separated transit will flow smoothly
NealEhardt / basics.js
Last active Jan 25, 2019
JavaScript language basics
View basics.js
* Basic operations with JavaScript arrays, functions, objects, and strings.
* JavaScript is a small language. With ECMAScript 6 (ES6), it has some
* powerful functional programming tools. I focus on the idioms I've used often.
* If you learn these operations, you won't reach for third-party libraries as often.
* To run examples and verify the outputs, paste this file in your browser's console.
array: {
NealEhardt / TLC5971 Arduino Sine.jpg
Last active Mar 5, 2017
Paints a sine wave pattern to a variable number of TLC5971 chips.
NealEhardt / testTimeout.js
Last active Nov 6, 2020
Instrumentation for the event loop
View testTimeout.js
Paste this script in the console of a live website to quantify its lag.
This script calls `setTimeout` every 50ms. If the event loop takes more than 2x that long
to hit the callback, it's considered lag.
Consecutive laggy loops are counted together and then, after the lag passes, they are
logged to the console as a single warning.
Like this:
Lagged for 254 ms over 2 loop(s). Should have taken 100 ms (39% of actual).