Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'rack-legacy'
app = proc do |env|
use Rack::Legacy::Php, 'public'
end
run app
http {
...
server {
listen 80;
server_name myapp.com;
root /myapp/public;
passenger_enabled on;
}
...
}
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)