Skip to content

Instantly share code, notes, and snippets.

@netmute
netmute / error_handler.sh
Created Oct 23, 2015
bash error handler
View error_handler.sh
#!/usr/bin/env bash
set -e
error_handler() {
local lineno="$1"
local message="$2"
if [[ -n "$message" ]]; then
echo "error on line $lineno: $message"
else
@netmute
netmute / spinner.sh
Last active Sep 3, 2015
a simple spinning animation for your shell scripts
View spinner.sh
#!/usr/bin/env bash
#
# a simple spinning animation for your shell scripts
# prints message in front of spinner
# - argument 1: the message to print
spinner_init() {
printf "$1 "
}
@netmute
netmute / config.fish
Last active Oct 17, 2019
fish config
View config.fish
# frees up ctrl-s and ctrl-q
stty -ixon -ixoff
# set the go path
set --export PATH $GOPATH/bin $PATH
# rbenv
status --is-interactive && source (rbenv init - | psub)
@netmute
netmute / gist:2689625
Created May 13, 2012
Run a loop at defined intervals on Arduino.
View gist:2689625
/* Run a loop at defined intervals.
This was tested with an Arduino Uno.
Other boards might require tweaking of the boardFrequency constant.
*/
/* How many times per second timedLoop() gets executed */
int loopFrequency = 1;
void timedLoop() {
/* Do stuff. */
@netmute
netmute / README.md
Last active Sep 25, 2020
Game of Life
View README.md

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

View init.vim
" PLEASE NOTE: I'm assuming nvim defaults in this configuration.
" Regular vimmers might need to tweak here and there.
" Add autogenerated tags file to the lookup path.
set tags+=.git/tags
" Add fzf plugin.
set rtp+=/usr/local/opt/fzf
" Use a source for FZF that respects '.gitignore'.
@netmute
netmute / Molokai.itermcolors
Created Dec 2, 2011
iTerm Molokai Colorscheme
View Molokai.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.48771023750305176</real>
<key>Green Component</key>
<real>0.48781105875968933</real>
@netmute
netmute / Monokai.itermcolors
Created Dec 2, 2011
iTerm Monokai Colorscheme
View Monokai.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.30093687772750854</real>
<key>Green Component</key>
<real>0.36639997363090515</real>