Permalink
Browse files

add casual1, casual3

  • Loading branch information...
1 parent 5cf32ef commit ee0a8648eb48fd1c58dedf885b76b4dee19fd921 @ysasaki committed Oct 22, 2012
Showing with 3,122 additions and 0 deletions.
  1. +550 −0 presentations/hokkaidopm-casual1/css/impress.css
  2. +128 −0 presentations/hokkaidopm-casual1/hokkaidopm-casual1.md
  3. +46 −0 presentations/hokkaidopm-casual1/impress.remote.js
  4. +33 −0 presentations/hokkaidopm-casual1/impress.remote.server.js
  5. +229 −0 presentations/hokkaidopm-casual1/index.html
  6. +341 −0 presentations/hokkaidopm-casual1/js/impress.js
  7. +93 −0 presentations/hokkaidopm-casual1/js/impress.remote.client.js
  8. +12 −0 presentations/hokkaidopm-casual1/js/jquery.scrollTo-min.js
  9. BIN presentations/hokkaidopm-casual3/.DS_Store
  10. +550 −0 presentations/hokkaidopm-casual3/css/impress.css
  11. +193 −0 presentations/hokkaidopm-casual3/hokkaidopm-casual3.md
  12. +46 −0 presentations/hokkaidopm-casual3/impress.remote.js
  13. +33 −0 presentations/hokkaidopm-casual3/impress.remote.server.js
  14. +278 −0 presentations/hokkaidopm-casual3/index.html
  15. +341 −0 presentations/hokkaidopm-casual3/js/impress.js
  16. +93 −0 presentations/hokkaidopm-casual3/js/impress.remote.client.js
  17. +12 −0 presentations/hokkaidopm-casual3/js/jquery.scrollTo-min.js
  18. +39 −0 presentations/hokkaidopm-casual3/lib/PerlIO/via/Collector64.pm
  19. +13 −0 presentations/hokkaidopm-casual3/scripts/collector.t
  20. +15 −0 presentations/hokkaidopm-casual3/scripts/open.pl
  21. +2 −0 presentations/hokkaidopm-casual3/scripts/out.txt
  22. +24 −0 presentations/hokkaidopm-casual3/scripts/stdin.pl
  23. +16 −0 presentations/hokkaidopm-casual3/scripts/strings.t
  24. +33 −0 presentations/hokkaidopm-casual3/scripts/use-open.pl
  25. +2 −0 presentations/hokkaidopm-casual3/scripts/word.txt
Oops, something went wrong.
@@ -0,0 +1,128 @@
+fluxflex
+========
+
+Hokkaido.pm Casual#1
+[@aloelight](https://twitter.com/#!/aloelight)
+
+
+fluxflexとは
+------------
+
+ - The fastest way to launch your web services.
+ - PaaS
+ - perl-5.10.1
+ - Apache 2.2.17 + mod\_fastcgi(?)
+ - MySQL 5.5.12
+
+PaaS比較
+--------
+
+ - heroku
+ - Perl使えません
+ - dotCloud
+ - 値段とか考えると個人向けじゃないっぽい
+ - fluxflex
+ - 個人向けっぽい[価格設定](https://www.fluxflex.com/settings/billing)
+
+なんでPaaS?
+-----------
+
+ - Webアプリを作ってすぐ公開したい
+ - サーバ設定・運用って大変
+ - rails + heroku が羨ましかった
+
+Dancerを動かしてみよう
+----------------------
+
+1. アカウント登録
+-----------------
+
+[登録画面](http://www.fluxflex.com/registrations?)から普通に登録
+
+登録方法は以下の3つ
+
+ - email + password
+ - twitter
+ - facebook
+
+2. SSH公開鍵の登録
+--------------
+
+公開鍵を登録する
+
+ 1. `ssh-keygen -t rsa -b 2048 -f fluxfex`
+ 1. pbcopy < fluxflex.pub
+ 1. [登録画面](http://www.fluxflex.com/settings/pubkeys)に貼り付け
+
+3. プロジェクト作成
+-------------------
+
+ - デフォルトのを削除して、新規作成
+ - Setup > Git からclone用のコマンドをコピー
+ - 自分のローカルにclone
+
+4. プロジェクト修正
+-------------------------
+
+ dancer -a MyApp
+ cp -r MyApp/ clone-path/
+ cd clone-path/
+ ln -s public public_html
+ vim public_html/.htaccess
+ vim .flx
+
+5. .htaccess
+------------
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+ AddHandler fastcgi-script .fcgi
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ /dispatch.fcgi$1 [QSA,L]
+
+6. .flx
+-------
+
+ [deploy]
+ cpanm -L local -v --notest --installdeps .
+
+ [setup]
+ bash cpanm-setup.sh
+
+6-2. cpanm-setup.sh
+-------------------
+
+ #!/bin/bash
+ curl -kL http://install.perlbrew.pl | bash
+ echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
+ bash
+ perlbrew install-cpanm
+ cpanm -L local YAML Dancer Plack
+ cpanm -L local --notest --installdeps .
+
+7. Setup & Deployを実行
+-----------------------
+
+ - pushしたらdeployされるけど、setupを行いたいので手動で実行
+ - 完了したらサイトにアクセス!
+
+残念でした!動きません!
+-------------------
+
+試行錯誤してみる
+------------
+
+ 1. "|"が食われた
+ - setupをshell scriptに変更
+ 1. deploy操作が600secでタイムアウトする
+ - cpanmに--notestを追加
+ 1. まだタイムアウト
+ - cpanm -Lを-lに変更
+
+やっぱりダメでした
+------------------
+
+次回に続くかも……
@@ -0,0 +1,46 @@
+/**
+ * impress.remote.js
+ *
+ * MIT Licensed.
+ *
+ * Copyright 2012 Yoshihiro Sasaki (@aloelight)
+ */
+var util = require('util')
+ , express = require('express')
+ , WebSocketServer = require('ws').Server;
+
+function Remote(options, callback) {
+ var server = express.createServer();
+ server.configure(function(){
+ server.use(express.static(__dirname));
+ });
+ WebSocketServer.call(this, {server:server}, callback);
+ var self = this;
+ this.on('connection', function(ws) {
+ console.log('Client connected');
+ ws.on('message', function(message) {
+ console.log('received: %s', message);
+ self.broadcast(ws, message);
+ });
+ ws.send('Connected to impress.remote.js');
+ });
+ server.listen(options.port, options.host);
+ return this;
+};
+util.inherits(Remote, WebSocketServer);
+
+Remote.prototype.broadcast = function(sender, message) {
+ var len = this.clients.length;
+ for ( var i = 0; i<len; i++ ) {
+ var c = this.clients[i];
+ if ( c === sender ) {
+ c.send('broadcast: ' + message);
+ }
+ else {
+ c.send(message);
+ }
+ }
+};
+
+module.exports = Remote;
+
@@ -0,0 +1,33 @@
+/**
+ * impress.remote.server.js
+ *
+ * MIT Licensed.
+ *
+ * Copyright 2012 Yoshihiro Sasaki (@aloelight)
+ */
+var Remote = require('./impress.remote')
+ , opt = require('getopt');
+
+// set default opt
+var host = '127.0.0.1', port = 3000;
+
+try {
+ opt.setopt("h:p:");
+} catch (e) {
+ console.dir(e);
+ process.exit(1);
+}
+opt.getopt(function(o,p) {
+ switch(o) {
+ case "h":
+ host = p[0];
+ break;
+ case "p":
+ port = p[0];
+ break;
+ }
+});
+
+var server = new Remote({host:host, port:port});
+console.log("Starting Impress.js Remote Server(%s:%s)...", host, port);
+
Oops, something went wrong.

0 comments on commit ee0a864

Please sign in to comment.