Skip to content

Instantly share code, notes, and snippets.

View pasberth's full-sized avatar

pasberth pasberth

View GitHub Profile
@pasberth
pasberth / ruby_hash_literal_with_here_document.md
Created July 17, 2012 11:28 — forked from repeatedly/ruby_hash_literal_with_here_document.md
Why Ruby failed to parse a Hash literal with multiple here documents.

1 element

h = { 
  hoge: <<EOS
Hey!
EOS
}

p h
@pasberth
pasberth / sock.py
Created May 15, 2012 10:08 — forked from mana8626/sock.py
socketのなんか書きたかったけど無理だった
import socket
ss = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
ss.bind(('localhost', 8080))
ss.listen(5)
conn, addr = ss.accept()
#conn.send("Hello World")
print conn.recv(4096)
conn.shutdown(socket.SHUT_RDWT)