Skip to content

Instantly share code, notes, and snippets.

Avatar

ahtn ahtn

  • seethis.link
  • jem@seethis.link
View GitHub Profile
View eeprom-flash.sh
#!/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
View key_handler_example.c
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 ;
@ahtn
ahtn / google-it.ahk
Created Jun 30, 2017
Bash and Autohotkey scripts to google search highlighted text
View google-it.ahk
; 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
View split-force-slave.c
#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 / split-test-i2c.hex
Last active Jun 25, 2016
split keyboard i2c test hex
View split-test-i2c.hex
:100000000C9414070C94F00A0C945B070C945B0797
:100010000C945B070C945B070C945B070C945B07D8
:100020000C945B070C945B070C94E0100C94B211D9
:100030000C945B070C945B070C945B070C945B07B8
:100040000C945B070C94F9290C945B070C945B07E8
:100050000C945B070C94B71F0C945B070C945B0724
:100060000C945B070C945B070C945B070C945B0788
:100070000C945B070C945B070C945B070C945B0778
:100080000C945B070C945B070C945B070C945B0768
:100090000C94500A0C945B070C945B070C945B0760
@ahtn
ahtn / eeprom-left.eep
Created Jun 25, 2016
split-keyboard test hex
View eeprom-left.eep
:080000000000000000000001F7
:00000001FF
@ahtn
ahtn / onekey.hex
Created Nov 15, 2015
tmk onekey for promicro. Short pins 8 and 9 on the pro micro to type 'a'.
View onekey.hex
:100000000C9431010C9478010C9478010C947801D3
:100010000C9478010C9478010C9478010C9478017C
:100020000C9478010C9478010C945F140C943115A5
:100030000C94F00E0C9478010C9478010C947801D7
:100040000C9478010C9478010C9478010C9478014C
:100050000C9478010C942E0F0C9478010C94780178
:100060000C9478010C9478010C9478010C9478012C
:100070000C9478010C9478010C9478010C9478011C
:100080000C9478010C9478010C9478010C9478010C
:100090000C9478010C9478010C9478010C947801FC