Skip to content

Instantly share code, notes, and snippets.

@r3bo0t
r3bo0t / prompt_krao_setup
Last active December 18, 2015 14:48
a minimalistic prezto prompt theme. Keep it in .zprezto/modules/prompt/functions
function prompt_krao_precmd {
vcs_info
}
function prompt_krao_setup {
autoload -Uz vcs_info
add-zsh-hook precmd prompt_krao_precmd
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '!'
@sauloperez
sauloperez / signal_catching.rb
Last active November 11, 2020 11:25
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {