Skip to content

Instantly share code, notes, and snippets.

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');
# 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");
}

Benchmarking Nginx with Go

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を眺めてみたメモ。

00. simple

基本的な構成。npm install & grunt serverhttp://localhost:3030で起動する(以下のexampleも同様)。

01. config

00ではindex.jsに直接書かれていたdataAdapterConfig/configディレクトリ内のファイルに分離。 NODE_ENVの値で本番/開発環境の設定ファイル切り替えを行う