Skip to content

Instantly share code, notes, and snippets.

View Fonsan's full-sized avatar

Erik Fonselius Fonsan

View GitHub Profile
link_to raw("We" + image_tag('heart.png') + " Feedback")
# generates
# <a class="footer_link" href="/feedback">We&lt;img alt="Heart" src="/images/heart.png?1297276993" /&gt; Feedback</a>
require 'socket'
puts "Please enter host:"
hostname = STDIN.gets.chop # Read host and remove the newline
port = 80
s = TCPSocket.open(hostname, port)
s.write("HEAD / HTTP/1.0\n")
require 'socket'
puts "Please enter host:"
hostname = STDIN.gets.chop # Read host and remove the newline
port = 80
s = TCPSocket.open(hostname, port)
s.write("HEAD / HTTP/1.0\n")