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
/** | |
* enchant.js Save/Load module | |
*/ | |
/** | |
* Namespace は適当に | |
*/ | |
var Storage = {}; | |
Storage.Event = { |
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
/* | |
* node-dataurl-proxy | |
* | |
* This code can run in Clound Foundry (http://cloudfoundry.com) | |
* You can see example: http://dataurlproxy.cloudfoundry.com/?url=[url] | |
*/ | |
require.paths.unshift('./node_modules'); | |
var express = require('express'), |
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 express = require('express'), | |
io = require('socket.io'), | |
fs = require('fs'); | |
var app = module.exports = express.createServer(); | |
// Configuration | |
app.configure(function(){ | |
app.set('views', __dirname + '/views'); |
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
CPU: AMD Phenom(tm) II X6 1090T | |
MEM: 16GB | |
OS: CentOS 5.5 | |
* test1.js | |
real 0m4.813s | |
user 0m4.790s | |
sys 0m0.011s |
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
/** | |
* Module dependencies. | |
*/ | |
var redis = require("redis"), | |
url = require('url'); | |
/** | |
* Initialize Cache with the given 'options'. | |
* Return the cache using Redis. | |
* |
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 jsdom = require('jsdom'); | |
jsdom.env({ | |
html: "<html><body></body></html>", | |
scripts: [ | |
'http://code.jquery.com/jquery-1.6.2.min.js', | |
'http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js' | |
] | |
}, function (err, window) { | |
var $ = window.jQuery; |
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 calc = function(n, callback) { | |
var sum = function(i, res) { | |
var func = (n>i) ? sum_tick : function(j,k) {callback(k);}; | |
func(i+1, res+i); | |
}; | |
var sum_tick = function(i, res) { | |
process.nextTick(function() { sum(i,res); }); | |
}; | |
sum(1,0); | |
}; |
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 kue = require('kue'), | |
redis = require('redis'), | |
url = require('url'); | |
kue.redis.createClient = function() { | |
var options = { host: 'localhost' }; | |
if (process.env.REDISTOGO_URL) { | |
var redisUri = url.parse(process.env.REDISTOGO_URL); | |
options = { | |
host: redisUri.hostname, |
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 controllers; | |
import models.Account; | |
import play.libs.OpenID; | |
import play.libs.OpenID.UserInfo; | |
import play.mvc.Before; | |
import play.mvc.Controller; | |
import play.mvc.With; | |
/** |
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 controllers; | |
import play.Play; | |
import play.mvc.Controller; | |
import play.mvc.results.RenderJson; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
public class MyController extends Controller { |
OlderNewer