$ lsof -i :$PORT -- set desired port, e.g. 3000
$ kill $PID -- set discovered PID, e.g. 2227
This file contains 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
let R = require("ramda") | |
let {Observable, Subject} = require("rx") | |
let scanFn = function (state, updateFn) { | |
if (typeof updateFn != "function" || updateFn.length != 1) { | |
throw Error("updateFn must be a function with arity 1, got " + updateFn) | |
} else { | |
return updateFn(state) | |
} | |
} |
This file contains 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
Nightmare.action("clickNth", function (selector, n, done) { | |
debug(".clickNth() on " + selector + ":" + n) | |
this.evaluate_now(function (selector, n) { | |
document.activeElement.blur() | |
var element = document.querySelectorAll(selector)[n] | |
if (!element) { | |
throw new Error('Unable to find element by selector: ' + selector) | |
} | |
var event = document.createEvent('MouseEvent') | |
event.initEvent('click', true, true) |
This file contains 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
Parallel – 2+ processes (or cores) | |
Concurrent – whatever | |
Parallel is for increasing throughput | |
Concurrent is for decreasing latency | |
Parallel is for non-interactive (performance) (few inputs, deterministic or non-deterministic) | |
Concurrent is for interactive (experience) (many inputs, non-deterministic) | |
Parallel – how fast it gets result |
This file contains 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
/* | |
Pascal's Triangle | |
1 | |
1 1 | |
1 2 1 | |
1 3 3 1 | |
1 4 6 4 1 | |
The numbers at the edge of the triangle are all 1, and each number inside the triangle is the sum of | |
the two numbers above it. Write a procedure that computes elements of Pascal's triangle by means of |
My code from: https://gist.github.com/penguinboy/762197
let isPlainObj = (o) => Object.prototype.toString.call(o) == "[object Object]"
// this ^ is enough. If you check prototypes – you're doing it wrong. If somethings pretends to be plain – we have to accept that
// e.g. this: https://github.com/jonschlinkert/is-plain-object is an entirely WRONG approach
let flattenObj = (obj, keys=[]) => {
return Object.keys(obj).reduce((acc, key) => {
return Object.assign(acc, isPlainObj(obj[key])
This file contains 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
import * as R from "ramda" | |
let Atom = R.curry((options, actions) => { | |
console.log(`@ Atom "${options.name || ""}" is called`) | |
return {$: "$"} | |
}) | |
let withLog = R.curry((options, Atom) => { | |
return (actions) => { | |
console.log(`@ Shell "withLog" is called`) |
This file contains 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
Object Oriented Programming | |
I Objects / Classes are main units of design | |
II Objects are namespaces (expression problem, duality with Functional Programming) | |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
III Delegation / Inheritance (type dependency) | |
IV Constructors (vs data constructors) | |
V Mutability (shared state) | |
VI Fluent API (http://paqmind.com/blog/fluent-api-debunked/) | |
VII Instance |
TODO
- Team agreed on technology set
- Licenses, cost of infrastructure etc. covered
- Operating model (including SLAs) determined