So consider the tikz code at listing tikz-eg1 and figure Tikz-out1:
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
| (eval-and-compile | |
| (customize-set-variable | |
| 'package-archives '(("org" . "https://orgmode.org/elpa/") | |
| ("melpa" . "https://melpa.org/packages/") | |
| ("gnu" . "https://elpa.gnu.org/packages/"))) | |
| (package-initialize) | |
| (unless (package-installed-p 'use-package) | |
| (package-refresh-contents) | |
| (package-install 'use-package))) |
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
| /** | |
| * USB HID Keyboard scan codes as per USB spec 1.11 | |
| * plus some additional codes | |
| * | |
| * Created by MightyPork, 2016 | |
| * Public domain | |
| * | |
| * Adapted from: | |
| * https://source.android.com/devices/input/keyboard-devices.html | |
| */ |
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
| function logClass(target: any) { | |
| // save a reference to the original constructor | |
| var original = target; | |
| // a utility function to generate instances of a class | |
| function construct(constructor, args) { | |
| var c : any = function () { | |
| return constructor.apply(this, args); | |
| } |
(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.
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
| /* Polyfill indexOf. */ | |
| var indexOf; | |
| if (typeof Array.prototype.indexOf === 'function') { | |
| indexOf = function (haystack, needle) { | |
| return haystack.indexOf(needle); | |
| }; | |
| } else { | |
| indexOf = function (haystack, needle) { | |
| var i = 0, length = haystack.length, idx = -1, found = false; |
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
| function inherit (child, parent) { | |
| function proxy () {}; | |
| proxy.prototype = parent.prototype; | |
| child.prototype = new proxy(); | |
| }; | |
| function Parent () {} | |
| function Child () {} | |
| inherit(Child, Parent); |
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
| function makeMembrane(){ | |
| var revokableWrappingHandler = new Proxy.revokable({}, { | |
| get: function(target, name){ | |
| return Reflect.call.bind(wrap(Reflect[name])); | |
| } | |
| }); | |
| var revoke = revokableWrappingHandler.revoke; | |
| var wrappingHandler = revokableWrappingHandler.proxy; | |
| var un2wrapped = new WeakMap(); |