I use the latest Puma v1.4.0 from rubygems.
Make sure you have nginx installed with these options:
>/opt/nginx/sbin/nginx -V
nginx version: nginx/1.0.15
built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
| # | |
| # = Capistrano database.yml task | |
| # | |
| # Provides a couple of tasks for creating the database.yml | |
| # configuration file dynamically when deploy:setup is run. | |
| # | |
| # Category:: Capistrano | |
| # Package:: Database | |
| # Author:: Simone Carletti <[email protected]> | |
| # Copyright:: 2007-2010 The Authors |
| # 30 minutes Lisp in Ruby | |
| # Hong Minhee <http://dahlia.kr/> | |
| # | |
| # This Lisp implementation does not provide a s-expression reader. | |
| # Instead, it uses Ruby syntax like following code: | |
| # | |
| # [:def, :factorial, | |
| # [:lambda, [:n], | |
| # [:if, [:"=", :n, 1], | |
| # 1, |
| #0> non-block call | |
| Thread.new do | |
| blahbla... | |
| end | |
| #1> 4 simple ways to call shell or cmd | |
| `ps aux` |
| #Person | |
| class Person | |
| end | |
| #class method | |
| class Person | |
| def self.address | |
| puts "hangzhou" | |
| end | |
| end |
| var PORT = 10443; | |
| var SSL_KEY = '___.key'; | |
| var SSL_CERT= '___.cert'; | |
| var fs = require('fs'); | |
| var io = require('socket.io').listen(PORT, { | |
| key : fs.readFileSync(SSL_KEY).toString(), | |
| cert : fs.readFileSync(SSL_CERT).toString() | |
| }); |
| #!/usr/bin/ruby | |
| require 'rss' | |
| # Usage | |
| # $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/ | |
| # episodes.rss | |
| # OR | |
| # $ ./railscasts.rb | |
| p 'Downloading rss index' |
I use the latest Puma v1.4.0 from rubygems.
Make sure you have nginx installed with these options:
>/opt/nginx/sbin/nginx -V
nginx version: nginx/1.0.15
built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |
| upstream myapp { | |
| server unix:///myapp/tmp/puma.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name myapp.com; | |
| # ~2 seconds is often enough for most folks to parse HTML/CSS and | |
| # retrieve needed images/icons/frames, connections are cheap in |
| gem 'devise' | |
| gem 'omniauth' | |
| gem 'omniauth-github' | |
| gem "omniauth-twitter" | |
| gem "omniauth-facebook" | |
| gem "omniauth-google-oauth2" |