Skip to content

Instantly share code, notes, and snippets.

View SCLeoX's full-sized avatar
👕
男装中...

Rin Tepis SCLeoX

👕
男装中...
View GitHub Profile
@jessejanderson
jessejanderson / schools.md
Last active May 9, 2024 07:36
Coronavirus (COVID-19) School Closures in the US

New site:

Please visit the link above for up-to-date content.

The rest of the page is left here for legacy reasons but will no longer be updated.

@Rich-Harris
Rich-Harris / footgun.md
Last active June 1, 2024 17:52
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@a0viedo
a0viedo / npmCommand
Created September 4, 2014 17:40
using npm programmatically
var npm = require('npm');
npm.load(function(err, npm){
npm.config.set('loglevel', 'silent');
npm.commands.show(['npm'], function(err, result){ /* not using any result on purpose*/});
console.log(npm.config.get('loglevel')); // this is printing 'silent'
});