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 elements = document.querySelectorAll("div"), | |
callback = (el) => { console.log(el); }; | |
// Spread operator | |
[...elements].forEach(callback); | |
// Array.from() | |
Array.from(elements).forEach(callback); | |
// for...of statement |
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 cluster = require('cluster'); | |
var fs = require('fs'); | |
if (!cluster.isMaster) { | |
process.on('message', function (e) { | |
e.args.unshift(function (result) { | |
fs.writeFileSync(e.path + '~', JSON.stringify({ result : result })); | |
fs.renameSync(e.path + '~', e.path); | |
process.exit(); | |
}); |
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 h { | |
cd ~/work/hatena/$1 | |
} | |
function _h { | |
local allfiles | |
local -a _projects _others | |
allfiles=`find ~/work/hatena/* -type d -maxdepth 0 -exec basename '{}' ';'` |
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; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTPD; | |
use AnyEvent::Util qw(run_cmd); | |
use Cwd; | |
my $httpd = AnyEvent::HTTPD->new (port => 9090); |
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
// ==UserScript== | |
// @name lleval-test | |
// @namespace http://d.hatena.ne.jp/Cherenkov/ | |
// @include * | |
// ==/UserScript== | |
// サンプルで使うJSONP供給源 | |
// lleval - run codes from your browser http://colabv6.dan.co.jp/lleval.html | |