var FB = require('fb'); | |
FB.api('oauth/access_token', { | |
client_id: process.env.FACEBOOK_APP_ID, | |
client_secret: process.env.FACEBOOK_SECRET, | |
grant_type: 'client_credentials' | |
}, function(res) { | |
if (!res || res.error) { | |
console.log('error occurred when getting access token:', res && res.error); | |
return; |
module.exports = (function() { | |
/* | |
Recursive Dimensional Clustering | |
http://lab.polygonal.de/articles/recursive-dimensional-clustering/ | |
*/ | |
var RDC = function (collide) { | |
this.collide = collide; | |
}; | |
// RDC.SUBDIVISION_THRESHOLD = 4; | |
// RDC.CONTACT_THRESHOLD = 0.1; |
<!doctype html> | |
<html lang='ja'> | |
<head> | |
<meta charset='utf-8' /> | |
<title>socket.io client test</title> | |
<script src="/json.js"></script> <!-- for ie --> | |
<script src="/socket.io/socket.io.js"></script> | |
<script src='http://www.google.com/jsapi'></script> | |
<script> | |
google.load('jquery', '1'); |
#Launch an instance http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html
#Setup EC2
chmod 400 key.pem
ssh -i key.pem ec2-user@YOUR_SERVER_IP
# npm自体をアップデート | |
npm update -g npm | |
# npm installのエイリアス | |
npm i | |
# tar.gzもインストールできる | |
npm i https://github.com/yukidarake/node-qc/archive/0.0.2.tar.gz | |
# githubからインストールできる |
// | |
// main.swift | |
// SwiftLine | |
// | |
// Created by ISHII 2bit on 2014/06/03. | |
// Copyright (c) 2014 buffer Renaiss. All rights reserved. | |
// | |
import Foundation |
using UnityEngine; | |
using System.Collections; | |
public class Loby : MonoBehaviour | |
{ | |
void OnEnable () | |
{ | |
// サーバー接続 | |
PhotonNetwork.ConnectUsingSettings ("0.1"); | |
} |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
- Go HTTP standalone (as the control group)
- Nginx proxy to Go HTTP
- Nginx fastcgi to Go TCP FastCGI
- Nginx fastcgi to Go Unix Socket FastCGI
rendr-examplesを眺めてみたメモ。
基本的な構成。npm install
& grunt server
でhttp://localhost:3030
で起動する(以下のexampleも同様)。
00
ではindex.js
に直接書かれていたdataAdapterConfig
を/config
ディレクトリ内のファイルに分離。
NODE_ENV
の値で本番/開発環境の設定ファイル切り替えを行う