Skip to content

Instantly share code, notes, and snippets.

View haarts's full-sized avatar

Harm Aarts haarts

View GitHub Profile
@haarts
haarts / prepare-commit-msg
Created August 5, 2014 08:29
Prepend pivotal feature number to commit message
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref --short HEAD | sed "s/^feature_\([0-9]*\).*/\1/")
if [ -n "$BRANCH_NAME" ]; then
sed -i.bak -e "1s/^/[#$BRANCH_NAME] /" $1
fi
@haarts
haarts / main.go
Created October 15, 2014 14:50
Get something from the notary
package main
import (
"fmt"
"log"
zmq "github.com/pebbe/zmq4"
)
func main() {
@haarts
haarts / gist:6b6a5568ef4b5761392b
Created November 11, 2014 12:27
Terminal output after switch BACK to Chrome OS
chronos@localhost ~/Downloads $ sudo startxfce4
Entering /mnt/stateful_partition/crouton/chroots/precise...
/usr/bin/startxfce4: Starting X server
X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.42-61-generic x86_64 Ubuntu
Current Operating System: Linux localhost 3.10.18 #1 SMP Wed Nov 5 23:26:34 PST 2014 x86_64
@haarts
haarts / gist:80a5362c4895a5a3700b
Created November 11, 2014 12:29
Message on the terminal after logging out of XFCE
Running exit commands...
/usr/bin/xinit: connection to X server lost
waiting for X server to shut down xscreensaver: 13:28:19: SIGHUP received: restarting...
xscreensaver: 13:28:19: running as harm/harm (1000/1000)
xscreensaver: 13:28:19: Can't open display: :1.0
xscreensaver: 13:28:19: running as harm/harm (1000/1000)
xscreensaver: 13:28:19: Errors at startup are usually authorization problems.
@haarts
haarts / gist:1452142b0d19fdf2ceaa
Created November 11, 2014 12:43
Terminal output after switch BACK to Chrome OS (from Trusty)
chronos@localhost ~/Downloads $ sudo enter-chroot -n trusty
Entering /mnt/stateful_partition/crouton/chroots/trusty...
(trusty)harm@localhost:~$ startxfce4
/usr/bin/startxfce4: Starting X server
X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-61-generic x86_64 Ubuntu
@haarts
haarts / install_curveZMQ
Last active August 29, 2015 14:09
Setup CurveZMQ and Go
This is a brief description on getting CurveZMQ going on Ubuntu 14.04. This assumes a working Go installation.
Order is important since ZeroMQ will check during compilation if libsodium is installed.
1. $ sudo apt-get install pkg-config
1. $ curl -O https://download.libsodium.org/libsodium/releases/libsodium-1.0.0.tar.gz
1. $ tar xzf libsodium-1.0.0.tar.gz
1. $ cd libsodium-1.0.0
1. $ ./configure && make && make check && sudo make install && sudo ldconfig
1. $ cd
1. $ curl -O http://download.zeromq.org/zeromq-4.0.5.tar.gz
#!/bin/bash
export JRUBY_HOME=/opt/jruby/bin/
case $1 in
start)
/opt/jruby/bin/jruby --server -J-Xmx256M -J-Xms256M /var/www/calculator.delaagsterekening.nl/httpdocs/current/main.rb & 2>>/tmp/calculator.out
;;
stop)
kill `cat /var/run/calculator.pid` ;;
*)
#any of these calls can fail in which case I want to continue with the remainder
#padding each call with a begin rescue block seems stupid. Moreover this feels like a loop over an array...
def check_sites
write "checking hi..."
check_site(HI_MET_TOESTEL) { |doc| (doc/"table.collapsable") }
check_site(HI_SIM_ONLY) { |doc| (doc/"table.collapsable") }
write "checking t-mobile..."
check_site(T_MOBILE_FLEX) { |doc| (doc/'tbody') }
check_site(T_MOBILE_RELAX) { |doc| (doc/'tbody') }
check_site(T_MOBILE_MYFAVES) { |doc| (doc/'tbody') }
[["2008-08-25","14"],["2008-11-24","7"],["2008-11-27","61"],["2008-12-04","17"],["2008-12-08","64"],["2008-12-17","1"],["2009-01-06","30"],["2009-03-02","1"],["2009-03-03","45"],["2009-03-04","2"],["2009-03-06","1533"],["2009-03-09","169"],["2009-03-16","41"],["2009-03-31","2"],["2009-04-01","1"],["2009-04-20","1"],["2009-05-04","470"],["2009-05-09","59"],["2009-05-12","763"],["2009-05-13","1336"],["2009-05-14","2088"],["2009-05-17","554"],["2009-05-18","1426"],["2009-05-19","711"],["2009-05-20","1378"],["2009-05-22","928"],["2009-05-23","168"],["2009-05-25","10384"],["2009-05-26","9868"],["2009-05-27","2626"],["2009-05-29","807"],["2009-05-31","82"],["2009-06-01","59"],["2009-06-02","239"],["2009-06-03","2458"],["2009-06-04","569"],["2009-06-06","141"],["2009-06-07","392"],["2009-06-09","1028"],["2009-06-14","29"],["2009-06-16","1052"],["2009-06-18","16882"],["2009-06-20","40"],["2009-06-21","387"],["2009-06-22","3193"],["2009-06-23","5"],["2009-06-26","1109"],["2009-06-27","573"],["2009-06-28","314"],["2009
return true if some_condition
return true if some_other_condition
return true if bla
return true if aap
return true if noot
return true if mies
return true if foo
return true if bar
return false