View hersha.zsh-theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT=' | |
$fg[cyan]%m: $fg[yellow]$(get_pwd)$(put_spacing)$fg[white]$(rvm_prompt_info)$(git_prompt_info) | |
$reset_color→ ' | |
ZSH_THEME_GIT_PROMPT_PREFIX="[git:" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]$reset_color" | |
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]+" | |
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[green]" |
View socket.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' # Sockets are in standard library | |
server = TCPServer.new(1234) | |
begin | |
while connection = server.accept | |
while line = connection.gets | |
break if line =~ /quit/ | |
puts line | |
connection.puts "Received!\n" | |
end |