Skip to content

Instantly share code, notes, and snippets.

View mattstifanelli's full-sized avatar

Matt Stifanelli mattstifanelli

  • Lecce, Italy
View GitHub Profile
@mattstifanelli
mattstifanelli / tryErb.erb
Created May 12, 2011 14:37
ERB File with Ruby code embedded into HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>try erb</title>
</head>
<body>
<p> % 99.downto(96) do |number|
<%= number %> bottles of beer…
% end
@mattstifanelli
mattstifanelli / webrick1.rb
Created May 12, 2011 14:52
The script launch a web server on port 2000 using WEBrick
#!/usr/bin/ruby
#---
# Excerpted from "Programming Ruby 1.9",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http://www.pragmaticprogrammer.com/titles/ruby3 for more book information.
#---
require 'webrick'