spinner()
{
local pid=$1
local delay=0.75
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
$(cmd) > /dev/null 2>&1
http://stackoverflow.com/questions/818255/in-the-shell-what-is-21
1 is the default file descriptor for stdout.
2 is the default file descriptor for stderr.
>& is shell syntax for "fold the previous (first) file descriptor into the forthcoming (second) file descriptor."
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# act like vim | |
setw -g mode-keys vi | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
bind-key -r C-h select-window -t :- | |
bind-key -r C-l select-window -t :+ | |
set-option -g default-shell /bin/zsh | |
set-option -g set-titles on |
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
// paths | |
var combine_dir = 'resources/assets'; | |
var build_dir = 'resources/assets/build'; | |
var less_file = 'main'; | |
var less_output = combine_dir + '/css'; | |
// set scripts to combine | |
var scripts = [ | |
'vendor/jquery/jquery.js', | |
'js/main.js' |
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
# Create htpasswd | |
htpasswd -c ${filename} ${username} | |
# Create htaccess file | |
AuthUserFile ${filename} | |
AuthType Basic | |
AuthName "${message}" | |
Require valid-user |