Skip to content

Instantly share code, notes, and snippets.

Jess Telford jesstelford

View GitHub Profile
View LEARNING_WEBDEV.md

Getting started

  • Everything except images in a website is text, so it's a lot of reading and writing. As such, it makes sense to use an editor built for the purpose to make your life easier.
  • Install Visual Studio Code (VSCode): https://code.visualstudio.com/
  • There are 3 main technologies that make up a website: HTML, CSS, JavaScript (JS)
@jesstelford
jesstelford / LEARNING_JS.md
Last active Jan 26, 2019
Learning JS links and suggestions
View LEARNING_JS.md

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 Mar 15, 2019
Putting links in code blocks on GitHub
View Links in markdown.md
@jesstelford
jesstelford / README.md
Last active Aug 29, 2016
Bug in autoprefixer v6.4.0 when used with postcss-discard-comments v2.0.4
View README.md
  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 Apr 1, 2019
Starving the Event Loop with Microtasks
View README.md

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 Apr 20, 2019
What is the JS Event Loop and Call Stack?
View event-loop.md

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 Jun 12, 2016
nethack 3.6.0 hints file for debian: `sys/unix/hints/linux`. More: http://jes.st/2015/compiling-playing-nethack-360-on-ubuntu/
View Makefile
#
# 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 Feb 21, 2019
Netflix on Raspberry Pi (incomplete)
View netflix-rpi.md

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 Apr 27, 2015
asyncSeries to ensure promises complete in correct order
View asyncSeries.js
/**
* 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
*/
View keybase.md

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:

You can’t perform that action at this time.