Skip to content

Instantly share code, notes, and snippets.

@bahtou
bahtou / eslint-prettier-summary.md
Last active Jul 14, 2019
eslint-prettier-summary
View eslint-prettier-summary.md

Prettier - An opinionated code formatter

Linters have two categories of rules:

Formatting rules: eg: max-len, no-mixed-spaces-and-tabs, keyword-spacing, comma-style... Prettier alleviates the need for this whole category of rules! Prettier is going to reprint the entire program from scratch in a consistent way, so it's not possible for the programmer to make a mistake there anymore :)

View Public Key
Key type: RSA
Key size: 4096
Fingerprint: 93EE 382B 45D6 7584 12FB 2500 F1F4 28F4 A2CB 6F5B
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Mailvelope v0.13.1
Comment: https://www.mailvelope.com
xsFNBFVvQuUBEADU9HYGvJL0nFBouna3uT3W0GFM7Jqit+XadLGT+XtDC2sK
9RLH9arSfI58YBcdTsNiBaHa3mkpTXGBBf/l89ttMPuAWw34VJpA+i8etzCe
@bahtou
bahtou / blocking.js
Created Mar 19, 2013
Blocking and Non-Blocking I/O
View blocking.js
//BLOCKING
var post = db.query('SELECT * FROM posts where id = 1');
// processing from this line onward cannot execute
// until the line above completes
doSomethingWithPost(post);
doSomethingElse();
//NON-BLOCKING
callback = function(post) {
// this will only execute when the db.query function returns.
You can’t perform that action at this time.