Skip to content

Instantly share code, notes, and snippets.

View jesstelford's full-sized avatar

Jess Telford jesstelford

View GitHub Profile
@jesstelford
jesstelford / LEARNING_JS.md
Last active August 2, 2019 23:58
Learning JS links and suggestions

Learn by doing

If you're brand new to the language (welcome!) start here: http://jsforcats.com/ (Silly name, but excellent content)

If you've already got a little bit of coding under your belt, the ⁠⁠absolute best⁠⁠ place / way to learn is with https://nodeschool.io workshops (Full disclosure; I've written 2 of them)

They're all free open source at your own pace workshops where you are given a bit of info, a task, and you must code it up before you can move on (it runs unit tests over your code to verify you completed it)

@jesstelford
jesstelford / Links in markdown.md
Last active June 6, 2022 13:56
Putting links in code blocks on GitHub
@jesstelford
jesstelford / README.md
Last active August 29, 2016 08:22
Bug in autoprefixer v6.4.0 when used with postcss-discard-comments v2.0.4
  1. $ git clone https://gist.github.com/3cdebdee4691ce5fdd4ae696db7f296f.git
  2. cd 3cdebdee4691ce5fdd4ae696db7f296f
  3. $ npm install
  4. $ npm start
  5. See the bug:
  TypeError: Cannot read property 'constructor' of null
    at clone (/home/teddy/dev/postcss-autoprefixer-bug/node_modules/autoprefixer/lib/prefixer.js:13:21)
    at clone (/home/teddy/dev/postcss-autoprefixer-bug/node_modules/autoprefixer/lib/prefixer.js:31:19)
    at clone (/home/teddy/dev/postcss-autoprefixer-bug/node_modules/autoprefixer/lib/prefixer.js:31:19)
@jesstelford
jesstelford / README.md
Last active November 14, 2023 12:26
Starving the Event Loop with Microtasks

Starving the Event Loop with microtasks

"What's the Event Loop?"

Sparked from this twitter conversation when talking about doing fast async rendering of declarative UIs in Preact

These examples show how it's possible to starve the main event loop with microtasks (because the microtask queue is emptied at the end of every item in the event loop queue). Note that these are contrived examples, but can be reflective of situations where Promises are incorrectly expected to yield to the event loop "because they're async".

  • setTimeout-only.js is there to form a baseline
@jesstelford
jesstelford / event-loop.md
Last active April 3, 2024 13:57
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@jesstelford
jesstelford / Makefile
Last active June 12, 2016 12:00
nethack 3.6.0 hints file for debian: `sys/unix/hints/linux`. More: http://jes.st/2015/compiling-playing-nethack-360-on-ubuntu/
#
# NetHack 3.6 linux $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Linux hints file
# This hints file provides a single-user tty build for Linux, specifically
# for Ubuntu dapper.
@jesstelford
jesstelford / netflix-rpi.md
Last active April 4, 2020 17:52
Netflix on Raspberry Pi (incomplete)

Note: as @clibois mentioned below, due to the DRM Netflix uses, all decoding has to be done in CPU, making it somewhat choppy.

Note 2: Even the RPi 3 suffers from these CPU limitations. There is the potentially risky option of overclocking your RPi 3, but I haven't tried this.

If you manage to get smooth playback, please contact me, or post your solution here

UPDATE: I can no longer get this method to work. I have tried using Chromium v47, and v48, and both result in Netflix error "Oops, something went wrong" / C7053-1807, for which I can find no description online. If you manage to get things up and running, please contact me!

OSMC

@jesstelford
jesstelford / asyncSeries.js
Created April 27, 2015 04:35
asyncSeries to ensure promises complete in correct order
/**
* Will execute success/fail in the order of the promises in the Iterable, even
* though they are executed in parallel.
*
* If `fail` is executed, no more promises in the series will be handled.
*
* @param promises An Iterable of Promises
* @param success a function which accepts the results of the promise
* @param fail a function which accepts the failure of the promise
*/

Keybase proof

I hereby claim:

  • I am jesstelford on github.
  • I am jesstelford (https://keybase.io/jesstelford) on keybase.
  • I have a public key whose fingerprint is FC98 1149 9D7A EB37 B053 1530 216F EC51 DFDC 3091

To claim this, I am signing this object:

@jesstelford
jesstelford / index.coffee
Last active August 29, 2015 13:57
Minimal node.js express example showcasing hoisting, type coercion, module patterns, closures, strict mode, and how to avoid nasty `undefined` issues.
# The same as `index.js`, but in Coffeescript. Try it out here: http://michaelficarra.github.io/CoffeeScriptRedux/#try:
express = require 'express'
class Foo
'use strict'
defaultQuery = {}
query: undefined
toString: ->
if @query?