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
<!doctype html> | |
<head> | |
<title>Ractive.js - hash to list</title> | |
<script src="../bower_components/ractive/Ractive.js"></script> | |
</head> | |
<body> | |
<main id="main"> | |
<script id="template" type="text/ractive"> | |
<h2>ハッシュのリスト表示</h2> |
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
package Moco::Moco::HTTPClient; | |
use Moo; | |
use MooX::late; | |
use Moco::Moco; | |
use AnyEvent::HTTP; | |
extends qw(Tatsumaki::HTTPClient); | |
has agent => ( is => 'rw', isa => 'Str', default => sub { join '/', __PACKAGE__ , $Moco::Moco::VERSION }); | |
has jar => ( is => 'rw', isa => 'HashRef', default => sub { +{version => 1} }); |
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 (global) { | |
'use strict' | |
var isBrowser = !! global.self | |
var isWorker = !! global.WorkerLocation | |
var isNodeJS = !! global.global | |
function Domain () {} | |
Domain.prototype.intercept = function (cb, she) { |
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 test = require('tape') | |
test('01', function (t) { | |
function MyError (message) { | |
if (Error.captureStackTrace) { | |
Error.captureStackTrace(this, this.constructor) | |
} else { | |
this.stack = (new Error).stack || '' | |
} | |
this.name = this.constructor.name | |
this.message = message || this.name |
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 (global) { | |
'use strict' | |
var isBrowser = !! global.self | |
var isWorker = !! global.workerLocation | |
var isNodeJS = !! global.global | |
function stringify (o, rep, sp) { | |
return JSON.stringify(o, (function (m) { | |
return function (key, val) { | |
if (val instanceof Error) return val.toString() |
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' | |
var stream = require('stream') | |
var util = require('util') | |
var types = { | |
'"timeout" must be "Number"': function (n) { return isNaN(n) } | |
, '"timeout" must be "Int".': function (n) { return (n + '').indexOf('.') !== -1 } | |
, '"timeout" must be over "0".': function (n) { return n < 0 } | |
} | |
function Timer (timeout, _opt) { |
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 Coro; | |
my $n = 0; | |
async { | |
print "async 1 - $n\n"; | |
$n++; | |
cede; |
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 app = Object.create(require('carom.js')).constructor() | |
function onError (err, req, res) { | |
console.error(err) | |
console.error(err.stack) | |
res.writeHead(500) | |
res.end(String(err)) | |
} |
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
<!doctype html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Ractiv.ate</title> | |
<head> | |
<body> | |
<div id="main"></div> | |
<script src="./bundle.js"></script> | |
</body> |
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 util = require('util') | |
var stream = require('stream') | |
var semaphore = require('semaphore') | |
function SemaphoreStream (count, option) { | |
stream.Duplex.call(this, (option || {})) | |
this.semaphore = semaphore(count) | |
this.finished = false |
OlderNewer