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 Ginger::Cookies; | |
use strict; | |
use Carp; | |
use List::Util qw(reduce); | |
use Data::Clone qw(clone); | |
require Exporter; | |
our $VERSION = '0.01'; | |
our @ISA = qw(Exporter); |
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
// server.js * this file | |
// /public/ | |
// index.html | |
// /js/ | |
// fuga.js | |
// hoge.js | |
// /css/ | |
// /img/ | |
// /etc/ | |
var WSS = require('ws').Server |
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 AnyEvent::WebService::ComicZin; | |
use strict; | |
use utf8; | |
use Encode; | |
use Carp; | |
use parent qw(AnyEvent::WebService::ToranoAna); | |
use URI::Escape; | |
use Web::Scraper; | |
our $VERSION = '0.01'; |
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 Command () { this.map = []; } | |
(function (cp) { | |
cp.set = function (pattern, cb) { | |
if (typeof cb !== 'function') | |
throw new Error('2nd argument must be "function"'); | |
if (typeof pattern !== 'string' && ! pattern instanceof RegExp) | |
throw new Error('1st argument must be "string" of "regexp"'); | |
this.map.push([ pattern, cb ]); | |
return this; | |
}; |
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 Dancer; | |
get '/' => sub { | |
my $resp = Dancer::Response->new( | |
content_type => 'text/plain', | |
content => "1234567890", | |
); | |
$resp->streamed(sub { |
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; | |
package Nodedoc; | |
use Carp; | |
use Path::Class qw(file dir); | |
our $VERSION = "0.04"; |
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 mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, mongodb = 'mongodb://localhost' | |
, db_name = 'Test' | |
, db = [ mongodb, db_name ].join('/') | |
, collection = 'users' | |
, crypto = require('crypto') | |
, hash_key = 'bd3dcffe8e4523ca98e80f51f5ec85c18d57ea87' |
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 a = { hoge: 'HOGE' | |
, fuga: 'FUGA' | |
}; | |
var b = { foo : 'FOO' | |
, bar : 'BAR' | |
}; | |
var new_mixed_hash = monkey.wrench(a, monkey.wrench(b)); | |
// "new_mixed_hash" is |
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 ejs = require('ejs'); | |
var usersEjs = './views/users.ejs'; | |
var users = require('fs').readFileSync( usersEjs, 'utf-8' ); | |
console.log( ejs.render( users, { | |
filename: usersEjs // required | |
, title : 'TITLE' | |
, users : [ 'hoge', 'huga', 'foo' ] |
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'; | |
module.exports = function (mongoose) { | |
mongoose = mongoose || require('mongoose'); | |
var note = { | |
type: String | |
, required: true | |
}; | |
var created = { | |
type: Date |