This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |