(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
| <!-- | |
| For other language: Instead of `ace/mode/ruby`, Use | |
| Markdown -> `ace/mode/markdown` | |
| Python -> `ace/mode/python` | |
| C/C++ -> `ace/mode/c_cpp` | |
| Javscript -> `ace/mode/javascript` | |
| Java -> `ace/mode/java` | |
| Scala- -> `ace/mode/scala` |
| /*jshint node:true*/ | |
| 'use strict'; | |
| /** | |
| * This scripts recursively renames every file and directory in the script path | |
| * from camelCase and UpperCamelCase to dash-case | |
| * | |
| * Do a backup before executing this script | |
| * | |
| * @lecense MIT |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // A thing I want to do | |
| // This flow only involves **one** promise, for example an ajax call | |
| // None of the subsequent `then` or `catch` calls, return new promises. | |
| var explode = false; | |
| var promise = new Promise(function(resolve, reject) { | |
| if (explode) { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| "use strict"; | |
| /** | |
| * Hypertext Transfer Protocol (HTTP) response status codes. | |
| * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} | |
| */ | |
| enum HttpStatusCode { | |
| /** | |
| * The server has received the request headers and the client should proceed to send the request body |
Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.
Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over: