Skip to content

Instantly share code, notes, and snippets.

View BoyPlankton's full-sized avatar

Vincent Marcus BoyPlankton

View GitHub Profile
alias ssh="ssh -o TCPKeepAlive=yes -o ServerAliveInterval=50"
package main
import (
"log"
"reflect"
"time"
)
func main() {
var selectCases = make([]reflect.SelectCase, 0)

Keybase proof

I hereby claim:

  • I am boyplankton on github.
  • I am boyplankton (https://keybase.io/boyplankton) on keybase.
  • I have a public key whose fingerprint is 3F4E EE35 33DE DF26 15A2 6143 6872 A431 35D8 0643

To claim this, I am signing this object:

@BoyPlankton
BoyPlankton / previousmonth.sql
Created September 29, 2015 16:20
Informix SQL example for generating appropriate timestamps for the beginning and ending of the previous month.
select to_date(to_char( today - 1 units month, '%Y-%m-01 00:00' ), '%Y-%m-%d %H:%M' ),
to_date(to_char( today, '%Y-%m-01 00:00' ), '%Y-%m-%d %H:%M' ) - 1 units second
from systables
where tabid = 1;
@BoyPlankton
BoyPlankton / RetryIfError.sh
Last active August 29, 2015 14:26
BASH function for automatically rerunning processes if they fail.
function retryIfError() {
dry=3 # Default number of tries
dtl=60 # Default number of seconds to wait
drc=0 # Default return code
cmd=$1 # Command to call
try=${2-$dry} # Number of times to try
ttl=${3-$dtl} # Number of seconds to wait before trying again
erc=${4-$drc} # Expected return code on success