TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
{ | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, | |
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, | |
"lib": [ | |
"esnext", | |
"dom" | |
] /* Specify library files to be included in the compilation. */, | |
// "allowJs": true, /* Allow javascript files to be compiled. */ |
⚠️ This article is outdated: Global CSS is an anti-pattern; components should be individually styled using tools such as styled-components. See Fix for the most recent, though still outdated styles from this article.
Most start their front end styles by throwing in a reset such as Eric Myer’s or the more fashionable normalize.css. I will say a few nasty things about both approaches before I present to you the perfectionist alternative: Your own custom foundation.
Foundation is a good word for a different approach. Resets strip user agent default styles back. Normalizing attempts to even out the differences and fix a few things. A foundation strips and adds style
#!/usr/bin/env node | |
const fs = require('fs'); | |
const http = require('http'); | |
const home = process.env.HOME; | |
const options = { | |
host: 'example.com', | |
path: '/', |
import os | |
import sys | |
import vlc | |
import pygame | |
def callback(self, player): | |
print 'FPS =', player.get_fps() | |
print 'time =', player.get_time(), '(ms)' |