| function newOperator(Constr, args) { | |
| var inst = Object.create(Constr.prototype); | |
| var result = Constr.apply(inst, args); | |
| if (typeof result === 'object' && result !== null) { | |
| return result; | |
| } | |
| return inst; | |
| } |
| target Distribution -> Behaviors -> Edit -> Forward Query Strings -> turn 'Yes' |
| <!doctype html> | |
| <input id="query" type="text"></input> | |
| <button id="search">Search</button> | |
| <p id="results"></p> | |
| <script src="bundle.js"></script> |
| # LBs have 8 cores. One is used for haproxy, rest are used for nginx workers | |
| worker_processes 7; | |
| worker_rlimit_nofile 90000; | |
| pid <PID_FILE>; | |
| events { | |
| use epoll; | |
| multi_accept off; | |
| accept_mutex off; |
| // Utility function for detecting generators. | |
| let isGenerator = x => { | |
| return Function.isGenerator && | |
| Function.isGenerator.call(x) | |
| } | |
| // Data type represents channel into which values | |
| // can be `put`, or `received` from. Channel is | |
| // very much like queue where reads and writes are | |
| // synchronized via continuation passing. |
The following example uses the '::' operator which has a proposal already and a champion on the committee. Other than the bind operator, the example I give uses no new syntax (other than what is new to ES6), and could fairly easily be polyfilled - though I expect it could be optimized if implemented natively. If you haven't seen Clojure protocols, they allow for single dispatch polymorpism based on type, without the methods being defined as part of that type. In clojure, they use the first parameter, but for my proposal, it uses the receiver (this), and uses the bind operator to make the call look similar to a normal method call. While I haven't actually written an implementation of the Protocol class I demonstrate here, I've thought enough about it that I feel it could be done in a few different ways without too much complexity.
/**
- The following module is a sampling of underscore methods conver
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
- Log into BF4 Battlelog.
- Visit the Customize emblem page.
- Select the emblem you wish to export.
- Open the console (Ctrl-Shift-J).
- Enter the following code snippet to copy the raw emblem data to the clipboard:
copy('emblem.emblem.load('+JSON.stringify(emblem.emblem.data,null,2)+');'); - Paste somewhere useful, like a gist. Whatever.
- Close the console (Ctrl-Shift-J).