(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.
(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.
| (function () { | |
| WebSocket.prototype._send = WebSocket.prototype.send; | |
| WebSocket.prototype.send = function (data) { | |
| this._send(data); | |
| this.addEventListener('message', function (msg) { | |
| console.log('>> ' + msg.data); | |
| }, false); | |
| this.send = function (data) { | |
| this._send(data); | |
| console.log("<< " + data); |
| /* | |
| * robotMaze.js | |
| * | |
| * The blue key is inside a labyrinth, and extracting | |
| * it will not be easy. | |
| * | |
| * It's a good thing that you're a AI expert, or | |
| * we would have to leave empty-handed. | |
| */ |
| // selection range | |
| var range = window.getSelection().getRangeAt(0); | |
| // plain text of selected range (if you want it w/o html) | |
| var text = window.getSelection(); | |
| // document fragment with html for selection | |
| var fragment = range.cloneContents(); | |
| // make new element, insert document fragment, then get innerHTML! |