Skip to content

Instantly share code, notes, and snippets.

View nu7hatch's full-sized avatar

Krzysztof Kowalik nu7hatch

  • Warsaw, Poland
View GitHub Profile
@nu7hatch
nu7hatch / _utils.bash
Last active December 18, 2015 16:29
Bash utilities for setup scripts.
# _utils.bash --- Utilities used across all the scripts.
ERROR_FILE="/tmp/setup_script_error.msg"
# Checks if user has cowsay installed, and if it does
# then uses it to display the message.
cowsay_or_echo()
{
cowsay=`which cowsay`
cowsay_eyes=$1; shift
# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)