Skip to content

Instantly share code, notes, and snippets.

rektide /
Created Nov 10, 2016
ruby rescue cost


I as concerned about whether the presence of rescue in Ruby had significant performance impact.

In JavaScript for example try/catch historically has had significant impact itself, even when no exceptions were being thrown.

Based on these benchmarks though, I can see Ruby doesn't seem to have significant cost for defining exception handlers.


rektide /
Last active Aug 25, 2016
Use `direnv` instead of systemd


Systemd is supposed to be the swiss army knife of starting things and keeping them going. For the most part, it works really really well. It has a very flexible developer-friendly way of letting one specify EnvironmentFile's providing environmental variables for programs it's launching.

The major pitfall is that it does not in any way support multi-line values. If you want to pass in a normal boring certificate to your applicatino (because you are a good respectful 12factor dev practicing proper config), you may be S.O.L (shit out of luck).

Thie horrible helper, direnv-launch, lets one use direnv-ish files when launching programs. Direnv's .envrc files can be multi-line, which is great. This is also going to be compatible and useful with your fellow Mac & Windows developers. Note that variables must be declared as export in envrc, as in export FOO=bar, which is different, but closely mimics how everything

rektide / become.yml
Last active Jul 28, 2016
become changes ansible_ssh_user
View become.yml
- hosts: all
# this is created with my username in my homedir
- file: path=~/ansible-become-test state=directory owner="{{ansible_ssh_user}}"
# this is owned by root
- file: path=/opt/ansible-become-test state=directory owner="{{ansible_ssh_user}}"
become: True
rektide / battery-one-oh.prom
Created Jul 25, 2016
battery charge, battery voltage, current drain, voltage*current (power)
View battery-one-oh.prom
rektide / direnv-launch
Created Jul 21, 2016 — forked from mfowlewebs/direnv-launch
View direnv-launch
. ./.envrc
eval $*
View foocollector.go
package main
import (
type FooCollector struct {
foo string
rektide /
Last active Mar 23, 2020
Class sugar

Class sugar

This project is a reference corpus for exploring similarities and differences in conventional JavaScript inheritance ("Naive"), ES6 Classes ("Classes"), as well as an example of trying to ape classes ("Sugarfree"). It consists of a chart of JavaScript property descriptors where comparison is possible, and of reference implementations of class-like structures/systems, in:

rektide /
Created Mar 9, 2016
Editor Hotkey Table

Back/Forward Hotkeys

Browser Primary Secondary
Firefox Alt-← / Alt-→ Control-] / Control-[
Chrome Alt-← / Alt-→
Eclipse Alt-← / Alt-→
Sublime Alt-- / (none)
VS Control-- / Control-+
Atom ??


Maps are a way to store and get values by a key.

var map1= new Map(),
  keySimple = "hello",
  keyComplex = {"hello": true},
map1.set(keySimple, {"to": "world"})
map1.set(keyComplex, {"to": "you"})
rektide / gist:2210b1514b79c586449d
Created Jan 14, 2016
OpenShift: my first 15 minutes
View gist:2210b1514b79c586449d
oc project userX-smoke
oc project user16-smoke
oc routes
oc get routes
oc get -h
oc get -h
oc get pods
oc get {pods,replicationController}
oc get pods
oc get replicationController