I hereby claim:
- I am cantremember on github.
- I am sleepbotzz (https://keybase.io/sleepbotzz) on keybase.
- I have a public key whose fingerprint is F8E3 7AF5 2D2E 8610 20B1 37F6 0CDB 6BDD 69D9 8F81
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * fewer lines, sure ... | |
| */ | |
| function _sameLineStyle() { | |
| return example.firstMethod().then(function() { | |
| return example.secondMethod(); | |
| }).then(function() { | |
| return example.thirdMethod(); | |
| }); | |
| } |
| // const ... | |
| var EARLY_RETURN; | |
| function _getSomething(key, data) { | |
| var scopedResult; | |
| return cache.fetchSomething(key) | |
| .then(function(_resolved) { | |
| scopedResult = _resolved; | |
| if (scopedResult) { |
| /** | |
| * be careful to return a Promise from every exiting branch | |
| */ | |
| function mayReject(may) { | |
| if (may || (may === undefined)) { | |
| return Promise.reject(new Error('I REJECT')); | |
| } | |
| return Promise.resolve(true); | |
| } |
| function fooAndBarInParallel() { | |
| // boiler-plate. meh | |
| var constructed = new Promise(function(resolve, reject) { | |
| emitter.once('foo', function(food) { | |
| resolve(food); | |
| }); | |
| }); | |
| // such clean. so code | |
| var deferred = Promise.deferred(); |
| /* | |
| consumer.js | |
| `node consumer.js` | |
| */ | |
| import Lib from './lib'; | |
| const { method: libMethod } = Lib; // <= 2-step destructure | |
| console.log(Lib.method()); | |
| console.log(libMethod()); |
| class Foo { | |
| method() { | |
| return 'foo'; | |
| } | |
| } | |
| class Wrapper { | |
| constructor(wrapped) { | |
| this.latch = 2; // arbitrary condition; "proxy it this many times" | |
| return new Proxy(wrapped, this); |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu-i386-14.10" | |
| # Node.js server port, per `config.app.port` | |
| config.vm.network "forwarded_port", guest: 3201, host: 3201 | |
| # # for remote inspection using `webkit-devtools-agent` or some equivalent | |
| # config.vm.network "forwarded_port", guest: 3999, host: 3999 | |
| config.ssh.forward_agent = true |
| daemonize yes | |
| logfile "/var/log/redis/redis-server.log" | |
| save "" | |
| dir /tmp | |
| # lots of connections | |
| maxclients 10000 | |
| # low tolerance for under-run | |
| # otherwise, redis-server gets a memory leak |
| #!/bin/bash | |
| # | |
| # https://perf.wiki.kernel.org/index.php/Main_Page | |
| # https://perf.wiki.kernel.org/index.php/Tutorial#Sampling_with_perf_record | |
| # https://perf.wiki.kernel.org/index.php/Tutorial#Sample_analysis_with_perf_report | |
| sudo apt-get install -y linux-tools-`uname -r` | |
| sudo apt-get install -y linux-tools-common | |
| sudo apt-get install -y linux-cloud-tools-`uname -r` | |
| sudo apt-get install -y linux-cloud-tools-common |