Skip to content

Instantly share code, notes, and snippets.

View ahtn's full-sized avatar

ahtn ahtn

  • seethis.link
  • jem@seethis.link
View GitHub Profile
@ahtn
ahtn / onekey.hex
Created November 15, 2015 00:09
tmk onekey for promicro. Short pins 8 and 9 on the pro micro to type 'a'.
:100000000C9431010C9478010C9478010C947801D3
:100010000C9478010C9478010C9478010C9478017C
:100020000C9478010C9478010C945F140C943115A5
:100030000C94F00E0C9478010C9478010C947801D7
:100040000C9478010C9478010C9478010C9478014C
:100050000C9478010C942E0F0C9478010C94780178
:100060000C9478010C9478010C9478010C9478012C
:100070000C9478010C9478010C9478010C9478011C
:100080000C9478010C9478010C9478010C9478010C
:100090000C9478010C9478010C9478010C947801FC
@ahtn
ahtn / eeprom-left.eep
Created June 25, 2016 05:24
split-keyboard test hex
:080000000000000000000001F7
:00000001FF
@ahtn
ahtn / split-test-i2c.hex
Last active June 25, 2016 06:08
split keyboard i2c test hex
:100000000C9414070C94F00A0C945B070C945B0797
:100010000C945B070C945B070C945B070C945B07D8
:100020000C945B070C945B070C94E0100C94B211D9
:100030000C945B070C945B070C945B070C945B07B8
:100040000C945B070C94F9290C945B070C945B07E8
:100050000C945B070C94B71F0C945B070C945B0724
:100060000C945B070C945B070C945B070C945B0788
:100070000C945B070C945B070C945B070C945B0778
:100080000C945B070C945B070C945B070C945B0768
:100090000C94500A0C945B070C945B070C945B0760
#define FORCE_MASTER 1
// this code runs before the usb and keyboard is initialized
void matrix_setup(void) {
#if FORCE_MASTER
// forced master
isLeftHand = true;
keyboard_master_setup();
sei();
@ahtn
ahtn / google-it.ahk
Created June 30, 2017 22:06
Bash and Autohotkey scripts to google search highlighted text
; This Autohotkey script does a google search on the highlighted-text
SendMode Input
RegRead, OutputVar, HKEY_CLASSES_ROOT, http\shell\open\command
StringReplace, OutputVar, OutputVar,"
SplitPath, OutputVar,,OutDir,,OutNameNoExt, OutDrive
browser=%OutDir%\%OutNameNoExt%.exe
!^s::
{
BlockInput, on
bit_t is_media_keycode(keycode_t keycode) {
return is_media(keycode);
}
void handle_media_keycode(keycode_t keycode, key_event_t event) REENT {
uint8_t consumer_code = 0;
if (event == EVENT_PRESSED) {
switch (keycode) {
case KC_MEDIA_NEXT_TRACK : consumer_code = HID_CONSUMER_SCAN_NEXT_TRACK ; break ;
case KC_MEDIA_PREV_TRACK : consumer_code = HID_CONSUMER_SCAN_PREVIOUS_TRACK ; break ;
#!/bin/bash
ls /dev/tty* > /tmp/1;
echo "Reset your Pro Micro now";
while [[ -z $USB ]]; do
sleep 1;
ls /dev/tty* > /tmp/2;
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`;
done;
avrdude -p m32u4 -c avr109 -P $USB -U eeprom:w:./eeprom-lefthand.eep -u