Skip to content

Instantly share code, notes, and snippets.

View brewski's full-sized avatar

Brian Abreu brewski

  • Nuts.com
  • Bend, OR
View GitHub Profile
@brewski
brewski / piece_spec_hash.php
Last active June 4, 2018 16:10
piece spec hash implementation in php
<?php
error_reporting(E_ALL);
class AV {
function __construct($id, $qualifier_1, $qualifier_2) {
$this->id = $id;
$this->qualifier_1 = $qualifier_1;
$this->qualifier_2 = $qualifier_2;
}
@brewski
brewski / piece_spec_hash.rb
Last active May 10, 2018 22:41
piece spec hash implementation in ruby
require "digest"
def av_hash_62bit(av_components)
av_components.
map(&Digest::SHA256.method(:digest)).
reduce(Digest::SHA256.new, &:update).
digest.
unpack("Q>").
first & 0x3fffffffffffffff
end
#!/bin/bash
# The easiest way to figure this out is to create a re-remapping in System Preferences ui, and then
# `defaults -currentHost read | grep com.apple.keyboard.modifiermapping`
keyboard_id="1452-632-0"
config_key="com.apple.keyboard.modifiermapping.${keyboard_id}"
# key_left_cmd=30064771299
key_right_cmd=30064771303
key_esc=30064771113