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 socket = null; | |
function bootstrap() { | |
// 適当な図形を描画 | |
var c = document.getElementById('mycanvas'); | |
var ctx = c.getContext('2d'); | |
ctx.globalalpha = 0.3; | |
for(var i=0; i<1000; i++) { | |
ctx.beginPath(); |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var rpcMethods = require('./methods.js'); | |
var app = module.exports = express.createServer(); | |
// Configuration |
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 page = new WebPage(), | |
address, output, size; | |
if (phantom.args.length != 2) { | |
console.log('Give me URL and filename'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
page.viewportSize = { width: 1024, height: 768 }; |
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
/** | |
* Enable route to __noSuchMethod__ when unknown method calling. | |
* | |
* @param {Object} obj Target object. | |
* @return {Object} | |
*/ | |
function enableMethodMissing(obj) { | |
var functionHandler = createBaseHandler({}); | |
functionHandler.get = function(receiver, 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
// For node-mongodb-native (npm install mongodb) | |
var mongodb = require('mongodb'); | |
var MongoTransaction = function(db) { | |
this.db = db; | |
this.queue = []; | |
this.running = false; | |
this.failureFn = 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
/** | |
* cybozu-connect for Node | |
*/ | |
var jsdom = require('jsdom'), | |
XMLHttpRequest = require('XMLHttpRequest').XMLHttpRequest; | |
var document, | |
window, | |
$, | |
CBLabs = {}, |
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
module.exports = function urlFetch(urlString, callback) { | |
var url = require('url').parse(urlString); | |
var module = url.protocol === 'https:' ? require('https') : require('http'); | |
require('http').get({ | |
host: url.hostname, | |
port: url.port, | |
path: url.path | |
}, function(res) { | |
var body = ''; | |
res.on('data', function(chunk) { |
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
#include <stdlib.h> | |
#include <stdexcept> | |
#include <iostream> | |
#include <XnCppWrapper.h> | |
#include <XnUSB.h> | |
#define VID_MICROSOFT 0x45e | |
#define PID_NUI_MOTOR 0x02b0 | |
XN_USB_DEV_HANDLE dev; |
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 fast_fib_module(stdlib, foreign, heap) { | |
"use asm"; | |
function fib(n) { | |
n = n|0; | |
// nはint(符号の有無が不明の状態) | |
// 3はfixnum(0~2^31) | |
// 比較するためにnをシフト演算でunsignedに変換する | |
if (n >>> 0 < 3) { |
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
let OSTYPE = system('uname') | |
if OSTYPE == "Darwin\n" | |
set noswapfile | |
set nowritebackup | |
endif |
NewerOlder