Skip to content

Instantly share code, notes, and snippets.

@NealEhardt
NealEhardt / testTimeout.js
Last active November 6, 2020 21:58
Instrumentation for the event loop
/*
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).
*/
@NealEhardt
NealEhardt / TLC5971 Arduino Sine.jpg
Last active March 5, 2017 21:49
Paints a sine wave pattern to a variable number of TLC5971 chips.
TLC5971 Arduino Sine.jpg
@NealEhardt
NealEhardt / basics.js
Last active January 25, 2019 03:51
JavaScript language basics
/*
* 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
NealEhardt / cheat-sheet.txt
Last active February 3, 2020 20:53
NHHIP survey guide
I recommend these responses to the I-45 Virtual Community Workshop survey.
Take the survey at https://www.surveymonkey.com/r/MTHBX5S
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.