Skip to content

Instantly share code, notes, and snippets.

View citrus-lemon's full-sized avatar
🐟
fish-touching

Lemon citrus-lemon

🐟
fish-touching
  • Indeed, Inc.
  • Tokyo
  • 05:34 (UTC +09:00)
View GitHub Profile
@citrus-lemon
citrus-lemon / proxy.go
Last active May 11, 2018 16:12 — forked from chopachom/proxy.go
Simple TCP proxy in Golang
package main
import (
"flag"
"fmt"
"io"
"net"
)
var localAddress *string = flag.String("l", "localhost:9999", "Local address")
@citrus-lemon
citrus-lemon / keypress.rb
Created January 15, 2017 01:24 — forked from acook/keypress.rb
Read keypresses from user in terminal, including arrow keys using pure Ruby. This has since been folded into a much more robust gem called Remedy. https://rubygems.org/gems/remedy & https://github.com/acook/remedy
require 'io/console'
# Reads keypresses from the user including 2 and 3 escape character sequences.
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil