x-ite's diary

覚え書きです。想定読者は俺

2012-12-01から1ヶ月間の記事一覧

node.js nvm install

git clone git://github.com/creationix/nvm.git ~/.nvm source ~/.nvm/nvm.sh nvm install v0.8.16

SCP コマンドメモ

#~/.ssh/config Host web01 Hostname ec2-xxx.xxx.xxx.xxx.ap-northeast-1.compute.amazonaws.com IndentityFile /path/to/pem User ec2-user Port 22 #remote to local scp web01:~/$filename . #local to remote scp $filename web01:~/$uploaddir

node.js socket.io クライアントソケットの取得

var io = require('socket.io').listen(3000); io.sockets.on('connection', function(socket) { //接続してきたソケット socket; }); //すべての接続クライアント io.sockets.sockets; //特定のソケット io.sockets.socket(socketId);

windowsでSubversionサーバー

windowsでたまにsubversionサーバー管理をするのでユーザー追加 C:\Program Files\Apache Software Foundation\Apache2.2\bin\htpasswd.exe C:\etc\svn-auth-file user

Javascript Array.splice で削除

Javascriptで配列(Array)の要素を削除するときにdeleteを使うと要素がnullになってlengthが減らない。 var arr = [1, 2, 3, 4, 5]; //delete arr[3]; arr.splice(3, 1);

node.js socket.IO

Socket送信先メモ var express = require('express') , http = require('http') , app = express() ; var server = http.createSever(app).listen(3000, '0.0.0.0'); var io = require('socket.io') , io = io.listen(server) ; io.sockets.on('connection',…