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 EventEmitter = require('events').EventEmitter; | |
module.exports = function(initial) { | |
var value = initial, | |
emitter = new EventEmitter(), | |
get = function() { | |
return value; | |
}, | |
set = function(newValue) { | |
if (value === newValue) return; |
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
function(record) { | |
var encodedPayload = record.kinesis.data, | |
payload = new Buffer(encodedPayload, 'base64').toString('ascii') | |
return payload | |
} |
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
<script src="http://wzrd.in/standalone/dom-delegate@latest"></script> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
domDelegate(document.body).on('click', 'button', handleButtonClicks) | |
document.body.innerHTML = '<button>buton</button>' | |
}) | |
function handleButtonClicks(event) { | |
console.log('click', event) | |
} |
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
> mocha --require espower-babel/guess | |
/Users/shigerunakajima/fusion_bluster/src/google-calendar-button/event.js:1 | |
(function (exports, require, module, __filename, __dirname) { import dateAdder | |
^^^^^^ | |
SyntaxError: Unexpected reserved word | |
at Module._compile (module.js:439:25) | |
at Module._extensions..js (module.js:474:10) | |
at Object.extensions..js (/Users/shigerunakajima/fusion_bluster/node_modules/espower-babel/index.js:20:13) |
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 of = require('observable-form'), | |
form = document.querySelector('form'), | |
o = of(form) | |
o.on('change', (e) => { | |
let j = o.toJSON() | |
console.log('change', j) | |
let str = JSON.stringify(j) | |
localStorage.setItem('abc', str) |
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 es from 'event-stream'; | |
let value = 0; | |
es.readable((count, callback) => { | |
if (!count) // なぜ何回も呼ばれるのか? | |
document.querySelector('button').addEventListener('click', e => callback(null, e)) | |
}).pipe(es.map((data, callback) => { | |
value++; | |
callback(null, value) |
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 esprima from 'esprima' | |
const source = ` | |
import { | |
ActionTransform | |
} | |
from 'action-stream' | |
import { | |
actionType, target | |
} | |
from '../const' |
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
Show hidden characters
{ | |
"env": { | |
"plugins": [ | |
"babel-plugin-espower" | |
], | |
"production": { | |
"plugins": [ | |
"babel-plugin-unassert" | |
] | |
} |
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 JSHINT = require('jshint').JSHINT | |
var source = [ | |
'function goo() {}', | |
'foo = 3;' | |
]; | |
var options = { | |
undef: true | |
}; | |
var predef = { |
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
Option Explicit | |
''インストールパス | |
const INSTALL_PATH = "http://hoge.example.com/oreoreApply/ClickOneceSample.application" | |
'' アンインストールコマンドの入っているレジストリ | |
const REGISTRY_PATH = "Software\Microsoft\Windows\CurrentVersion\Uninstall" | |
'' 処理 | |
UnInstallAll() |
OlderNewer