Cheatsheets

ES2015+ cheatsheet

ES2015+ cheatsheet is A quick overview of new JavaScript features in ES2015, ES2016, ES2017, ES2018 and beyond. Block scoping Let function fn () { let x = 0 if (true) { let x = 1 // only inside this `if` } } Const <span class="token keyword">const</span> a <span class="token operator">=</span> <span class="token number">1</span> let is the new var. Constants work just like let, but can’t be reassigned. See: Let and const Backtick strings Interpolation <span class="token keyword">const</span> message <span class="token operator">=</span> <span...

Read more...

Emmet cheatsheet

Emmet is a markup language for expanding CSS rules into HTML Child: > nav>ul>li Expands to <nav> <ul> <li></li> </ul> </nav> Sibling: + section>p+p+p Expands to <section> <p></p> <p></p> <p></p> </section> Climb Up: ^ section>header>h1^footer Expands to <section> <header> <h1></h1> </header> <footer></footer> </section> Grouping: () section>(header>nav>ul>li)+footer>p Expands to <section> <header> <nav> <ul> <li></li> </ul> </nav> </header> <footer> ...

Read more...

C# 7 cheatsheet

Out Variables public void PrintCoordinates(Point p) { p.GetCoordinates(out int x, out int y); WriteLine($"({x}, {y})"); } out is used to declare a variable at the point where it is passed as an argument. Pattern Matching Is-expressions with patterns public void PrintStars(object o) { if (o is null) return; // constant pattern "null" if (!(o is int i)) return; // type pattern "int i" WriteLine(new string('*', i)); } Switch statements with patterns switch(shape) { ...

Read more...