Skip to content

Instantly share code, notes, and snippets.

View itszero's full-sized avatar

Zero Cho itszero

View GitHub Profile
#!/usr/bin/ruby -w
require 'socket'
server = TCPServer.open(7788)
loop do
Thread.start(server.accept) do |client|
client.write "[Host]:[Port]> "
target = ""
while s = client.getc.chr
client.write s
@itszero
itszero / main.rb
Last active August 29, 2015 13:56 — forked from josephcc/main.rb
steps = 5
(1..steps)
.map { |x| (1..steps-1).map { |y| [x, y] } }
.flatten(1)
.select { |x, y| steps - x - y > 0 }
.group_by { |x, y| x }
.each do |x, sets|
sets.each do |x, y|
puts [x, y].inspect