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
js> function f() { var bar = 1; bar == (bar = bar + 1) } | |
js> dis(f) | |
flags: CONSTRUCTOR | |
loc op | |
----- -- | |
main: | |
00000: one | |
00001: setlocal 0 | |
00005: pop | |
00006: getlocal 0 |
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
OMG Monodraw is super AWESOME!! | |
╔═══════════════════════╗ | |
║ ║ | |
┌──║ Scanning Job ║ | |
│ ║ ║ | |
│ ╚═══════════════════════╝ | |
│ |
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
module StateTree ( buildTree ) where | |
import Prelude hiding (lookup) | |
import Control.Monad.State | |
import Data.Map (Map, insert, insertWith, empty, lookup) | |
data Item = Item { | |
sId :: String, | |
pId :: String, | |
value :: [Char], |
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
So if we have configs like: | |
- All button from Red Button to Blue Button (style change) | |
- The form should have 1 sidebar, 1 main aread with 4 fields, instead of only 1 main area with 2 fields (layout change) | |
- W/o loging, the Submit button pressed, it should show error message in DOM instead of redirect to login page (behaviour change) | |
The config will have a variance-id, like case01, case02... | |
-- |
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
'use strict'; | |
/** | |
* A regulator connects Source and Reducer/Effect with regards of responsiveness. | |
*/ | |
class Regulator { | |
constructor(configs) { | |
this._source = null; |
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
var fs = require('fs'); | |
var request = require('request'); | |
/* | |
var plurkTokens = | |
{ "consumer_key": "<key>" | |
, "consumer_secret": "<secret>" | |
, "token": "<token>" | |
, "token_secret": "<secret>" | |
}; |
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
// This would provide `createFile`, `createReadStream`, `writeContent` and `createWriteStream`. | |
var FileSystem = require('FileSystem'); | |
var Reader = function() { | |
this.counter = 0; | |
}; | |
Reader.prototype = FileSystem.prototype; | |
Reader.prototype.paths = ['/tmp/urandom-1.txt', '/tmp/urandom-2.txt']; | |
Reader.prototype.start = function() { | |
this.mainPromise = Promise.resolve() | |
.then(function() { |
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
var Cube = function(width) { | |
this.width = width; | |
}; | |
Cube.prototype.volume = function() { | |
return Math.pow(this.width, 3); | |
}; | |
var cube = new Cube(4) | |
cube.volume = cube.volume.bind({ width: 3}); |
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
var Cuboid = function() { | |
this.volume = function() { | |
return this.cuboidSize[0] * | |
this.cuboidSize[1] * | |
this.cuboidSize[2] ; | |
}; | |
}; | |
Cuboid.prototype.cuboidSize = [12, 8, 10]; |
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
var Foo = function() {}; | |
Foo.prototype.bark = function() { | |
console.log('Foo barks'); | |
}; | |
var Bar = function() {}; | |
Bar.prototype = Foo.prototype; | |
Bar.prototype.bark = function() { | |
console.log('Bar barks'); | |
}; |
NewerOlder