Skip to content

Instantly share code, notes, and snippets.

@rektide
rektide / mssculpt.xinput
Created December 30, 2016 02:19
Microsoft Sculpt Comfort Mouse properties
$ xinput --list-props 17
Device 'ThinkPad Compact Bluetooth Keyboard with TrackPoint':
Device Enabled (139): 1
Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (300): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (301): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Accel Speed (283): 0.000000
libinput Accel Speed Default (284): 0.000000
libinput Accel Profiles Available (596): 1, 1
libinput Accel Profile Enabled (597): 1, 0
@rektide
rektide / README.md
Created November 10, 2016 19:40
ruby rescue cost

What/Why

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.

Results

@rektide
rektide / README.md
Last active August 25, 2016 20:33
Use `direnv` instead of systemd

Direnv-launch

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
rektide / become.yml
Last active July 28, 2016 14:56
become changes ansible_ssh_user
---
- hosts: all
tasks:
# 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
rektide / battery-one-oh.prom
Created July 25, 2016 01:03
battery charge, battery voltage, current drain, voltage*current (power)
http://localhost:9090/graph#%5B%7B%22range_input%22%3A%222h%22%2C%22end_input%22%3A%22%22%2C%22step_input%22%3A%22%22%2C%22stacked%22%3A%22%22%2C%22expr%22%3A%22node_power_supply_charge_now%22%2C%22tab%22%3A0%7D%2C%7B%22range_input%22%3A%222h%22%2C%22end_input%22%3A%22%22%2C%22step_input%22%3A%22%22%2C%22stacked%22%3A%22%22%2C%22expr%22%3A%22node_power_supply_voltage_now%22%2C%22tab%22%3A0%7D%2C%7B%22range_input%22%3A%222h%22%2C%22end_input%22%3A%22%22%2C%22step_input%22%3A%22%22%2C%22stacked%22%3A%22%22%2C%22expr%22%3A%22node_power_supply_current_now%22%2C%22tab%22%3A0%7D%2C%7B%22range_input%22%3A%222h%22%2C%22end_input%22%3A%22%22%2C%22step_input%22%3A%22%22%2C%22stacked%22%3A%22%22%2C%22expr%22%3A%22node_power_supply_current_now*node_power_supply_voltage_now%22%2C%22tab%22%3A0%7D%5D
@rektide
rektide / direnv-launch
Created July 21, 2016 15:14 — forked from mfowlewebs/direnv-launch
~/.bin/direnv-launch
#!/bin/zsh
. ./.envrc
eval $*
package main
import (
"fmt"
)
type FooCollector struct {
foo string
}
@rektide
rektide / README.md
Last active March 23, 2020 07:53
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
rektide / fwd-backs.md
Created March 9, 2016 15:54
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 ??
@rektide
rektide / weakmaps.md
Created February 19, 2016 02:01
WeakMaps

Weakmap

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"})