| ASCII code | Character | Description |
|---|---|---|
| 191 | ┐ | Box drawing character single line upper right corner |
| 192 | └ | Box drawing character single line lower left corner |
| 193 | ┴ | Box drawing character single line horizontal and up |
| 194 | ┬ | Box drawing character single line horizontal down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const deepClone = (obj, map = new WeakMap()) => { | |
| if (obj instanceof Date) return new Date(obj); | |
| if (obj instanceof RegExp) return new RegExp(obj); | |
| if (map.has(obj)) { | |
| return map.get(obj); | |
| } | |
| const allDesc = Object.getOwnPropertyDescriptors(obj); | |
| const cloneObj = Object.create(Object.getPrototypeOf(obj), allDesc); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "abbr": "AL", | |
| "name": "Alabama", | |
| "capital": "Montgomery", | |
| "lat": "32.361538", | |
| "long": "-86.279118" | |
| }, | |
| { | |
| "abbr": "AK", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| compose, | |
| concat, | |
| }; | |
| function apply(x, f) { | |
| return f(x); | |
| } | |
| function compose(...funcs) { |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |