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
var bluebird = require('bluebird'); | |
var queue; | |
var queueLen = 0; | |
function queueUp(fn) { | |
if (!queue) { | |
console.log('start'); | |
queue = bluebird.resolve(); | |
} | |
++queueLen; |
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
Statistical profiling result from isolate-0x102004a00-v8.log, (885 ticks, 90 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name | |
70 7.9% /usr/local/bin/node | |
6 0.7% /usr/lib/system/libsystem_platform.dylib | |
2 0.2% /usr/lib/system/libsystem_c.dylib | |
[JavaScript]: | |
ticks total nonlib name |
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
Statistical profiling result from isolate-0x102800000-v8.log, (4205 ticks, 405 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name | |
448 10.7% /usr/local/bin/node | |
23 0.5% /usr/lib/system/libsystem_platform.dylib | |
16 0.4% /usr/lib/system/libsystem_malloc.dylib | |
8 0.2% /usr/lib/system/libsystem_pthread.dylib | |
2 0.0% /usr/lib/system/libsystem_c.dylib |
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
T 1 1 1 1 1 1 1 1 1 | |
9 0 0 0 0 0 0 0 0 1 | |
9 0 0 0 0 0 0 0 0 1 | |
9 0 0 0 0 0 0 0 0 1 | |
9 0 0 0 0 0 0 0 0 1 | |
9 0 0 0 0 0 0 0 0 1 | |
0 0 0 0 0 0 0 0 0 1 | |
0 0 0 0 0 0 0 0 0 1 | |
0 0 0 0 0 0 0 0 0 1 | |
S 1 1 1 1 1 1 1 1 1 |
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
// index.js | |
const Pouchy = require('./src/index') | |
const db = new Pouchy({ name: 'kittens' }) | |
db.save({ name: 'meow' }) | |
.then(() => db.all()) | |
.then(docs => console.log(docs)) | |
// browserify index.js -o bundle.js | |
// load bundle.js into a <script src="...></script>, and you get |
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
$ kubectl describe pod kubernetes-dashboard-3543765157-94gj9 --namespace="kube-system" | |
Name: kubernetes-dashboard-3543765157-94gj9 | |
Namespace: kube-system | |
Node: / | |
Labels: k8s-app=kubernetes-dashboard | |
pod-template-hash=3543765157 | |
Status: Pending | |
IP: | |
Controllers: ReplicaSet/kubernetes-dashboard-3543765157 | |
Containers: |
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
vagrant ssh w1 -c "ip address show eth0 | grep 'inet ' | sed -e 's/^.*inet //' -e 's/\/.*$//'" |
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
var ITCOUNT = 1e6 | |
function a () { | |
return function b (z) { return z + 1 } | |
} | |
var sum1 = 0 | |
for (var i = 0; i < ITCOUNT; ++i) { | |
var toAdd1 = Math.random() | |
var start1 = process.hrtime()[1] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://unpkg.com/[email protected]/dist/react.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/react-dom.min.js"></script> | |
<script src="https://unpkg.com/redux@^3.5.2/dist/redux.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/react-redux.min.js"></script> | |
<script src="https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js"></script> | |
<script src="https://unpkg.com/redux-observable/dist/redux-observable.min.js"></script> | |
<meta charset="utf-8"> |
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
// install rxjs | |
// configure vscode to run this file | |
const Rx = require('rxjs') | |
const { Observable } = Rx | |
const EventEmitter = require('events') | |
const myEmitter = new EventEmitter() | |
const START_REGISTRATIONS_POLL = 'START_REGISTRATIONS_POLL' | |
const STOP_REGISTRATIONS_POLL = 'STOP_REGISTRATIONS_POLL' |