This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use FindBin; | |
use File::Slurp qw(read_file); | |
my %index = (); | |
while (<*>) { | |
if (/\.checks$/) { |
This file contains hidden or 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 Greeter; | |
use 5.008005; | |
use strict; | |
use Carp; | |
our $VERSION = "0.01"; | |
sub new { | |
my $class = shift; | |
bless +{} => $class; |
This file contains hidden or 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
elementTarget.addEventListener( type, listener [, useCapture ]) |