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
require 'rspec' | |
require File.expand_path('../../hash_with_value_indifferent_access',__FILE__) | |
describe HashWithValueIndifferentAccess do | |
context "initialize" do | |
before do | |
@hash = HashWithValueIndifferentAccess.new({:a=>:b}) | |
end | |
it "symbole value compare string value " do | |
@hash[:a].should == "b" |
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
#!/usr/bin/ruby | |
def init | |
(1..9).to_a.shuffle | |
end | |
success=0 | |
failure=0 | |
10000000.times do |
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 http = require('http') | |
, httpProxy = require('http-proxy') | |
, Cookie = require('cookie') | |
, fs = require('fs'); | |
var SERVERS_FILE_NAME = "servers.json" | |
var PROXY_PORT = 4000 | |
var SERVERS = null; | |
var g_httpProxies = {}; |
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> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/LearnBoost/socket.io-client/master/dist/socket.io.min.js"></script> | |
<script type="text/javascript" src="http://backbonejs.org/backbone-min.js"></script> | |
<script type="text/javascript"> | |
var ExampleRouter = Backbone.Router.extend({ |
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> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/LearnBoost/socket.io-client/master/dist/socket.io.min.js"></script> | |
<script type="text/javascript" src="http://backbonejs.org/backbone-min.js"></script> | |
<script type="text/javascript"> | |
var ExampleModel = Backbone.Model.extend({ |
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> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/LearnBoost/socket.io-client/master/dist/socket.io.min.js"></script> | |
<script type="text/javascript" src="http://backbonejs.org/backbone-min.js"></script> | |
<script type="text/javascript"> | |
jQuery(function() { |
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
app.use(express.session()); | |
app.use(express.csrf()); | |
app.get('/', index); | |
index = function(req,res,next){ | |
res.render('index',{token: req.session._csrf}); | |
} |
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 zp(num){ | |
return(num < 10 ? "0"+num.toString() : num.toString()); | |
} | |
function toISODate(d){ | |
return ISODate(d.getUTCFullYear() + "-" + zp(d.getUTCMonth() + 1) + "-" + zp(d.getUTCDate()) + "T"+zp(d.getUTCHours()) + ":" + zp(d.getUTCMinutes()) + ":" + zp(d.getUTCSeconds())); | |
} | |
function before(n){ | |
return toISODate(new Date(Date.now() - n * 1000)); | |
} | |
//accessコレクションのTimeフィールドのDataが600秒(10分)以内のレコードを検索 |
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 getPort(host,port,maxPort,callback) { | |
var net = require('net'); | |
var socket = new net.Socket(); | |
socket.on('error', function(e) { | |
if(e.code == 'ECONNREFUSED'){ | |
callback(null, port); | |
return; | |
} | |
loop(++port); | |
}); |
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
require('./lib/compiled'); | |
app.configure('development', function(){ | |
var Mincer = require('mincer'); | |
var environment = new Mincer.Environment(); | |
environment.appendPath(__dirname + '/app/assets/javascripts'); | |
app.use('/assets', Mincer.createServer(environment)); | |
ASSET_JS_PATH = null | |
}); | |
app.get('/', index); |