Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@damouse
damouse / nuclear_data.json
Last active December 22, 2023 01:47
qmk nuclear data
{
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n ompile and flash with: qmk json2c keyboards/kprepublic/jj50v2/keymaps/damouse/damouse.json > ./keyboards/kprepublic/jj50v2/keymaps/damouse/keymap.c && make kprepublic/jj50v2:damouse:flash",
"keyboard": "kprepublic/jj50",
"keymap": "kprepublic_jj50_layout_ortho_5x12_mine",
"layout": "LAYOUT_ortho_5x12",
"layers": [
[
"KC_ESC",
╔═════════════════╦════════════════════════════════════════╗
║ Syntax ║ Result ║
╠═════════════════╬════════════════════════════════════════╣
║ arr=() ║ Create empty array ║
║ arr=(1 2 3) ║ Initialize array ║
║ ${arr[2]} ║ Retrieve third element ║
║ ${arr[@]} ║ Retrieve all elements ║
║ ${!arr[@]} ║ Retrieve array indices ║
║ ${#arr[@]} ║ Calculate array size ║
║ arr[0]=3 ║ Overwrite 1st element ║
@damouse
damouse / nyquist 4x12 layout, qmk configurator
Last active July 29, 2021 01:44
Flash with `qmk flash sphinx.json -bl dfu-split-left`
{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"keebio/nyquist/rev3","keymap":"keebio_nyquist_rev3_layout_ortho_5x12_mine","layout":"LAYOUT_ortho_5x12","layers":[["KC_ESC","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_EQL","KC_U","KC_I","KC_O","KC_P","KC_Y","KC_TAB","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_UP","KC_ENT","KC_LCTL","KC_LALT","KC_LGUI","KC_NO","KC_DEL","MO(1)","KC_SPC","KC_BSPC","MO(2)","KC_LEFT","KC_DOWN","KC_RGHT","KC_LCTL","KC_LALT","KC_LGUI","KC_NO","KC_DEL","MO(1)","KC_SPC","KC_BSPC","
@damouse
damouse / Updated Atomic OLKB mapping
Last active August 23, 2020 17:12
OLKB Atomic mappings. Flash with qmk flash atomic.json -bl dfu
{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"atomic","keymap":"atomic","layout":"LAYOUT_ortho_5x15","layers":[["KC_ESC","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_NO","KC_NO","KC_NO","KC_NO","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_EQL","KC_RBRC","KC_BSLS","KC_END","KC_GRV","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_ENT","KC_VOLU","KC_PGUP","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","KC_VOLD","KC_UP","KC_PGDN","KC_LCTL","KC_LALT","KC_LGUI","LCTL(
@damouse
damouse / bump
Last active July 22, 2020 21:58
Script to automatically bump semver version.
#!/bin/bash
# Bumps the semantic version of the git-project.
# If no semantic version tags exist in the project, the version starts out at v0.0.0
# and is incremented by one for the field indicated by the bump command argument.
# Example Usage:
# Show the current tag
# bump -l
#include QMK_KEYBOARD_H
enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_FUNCTION,
_ADJUST,
};
"""
Print out the ANSI color codes for testing.
"""
import sys
for i in range(0, 16):
for j in range(0, 16):
code = str(i * 16 + j)
sys.stdout.write(u"\u001b[38;5;" + code + "m " + code.ljust(4))
@damouse
damouse / nginx.conf
Last active January 9, 2024 18:26
Nginx wss reverse proxy on the back of letsencrypt
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
@damouse
damouse / async_bluetoothctl.py
Last active September 6, 2018 18:00
Bluetoothctl text interface with asyncio in Python3.6
"""
A hilarious way to avoid writing DBus implementations by hooking into bluetoothd via the text interface
presented by bluetoothctl. You can do anything bluetoothctl can do except see live events.
In my case, I needed simple ability to pair with an Xbox One controller in python 3.6 with asyncio,
and getting dbus set up made my teeth hurt. This implementation is half serious-- its written to back
honest-to-god production software, but I can't in good conscious advise you to ever use it.
Tested with bluez 5.41 and 5.55, python3.6, and ubuntu 16.04. The only dependency is pexpect, which you
can install with:
[
{
"class": "title_bar",
"fg": ["background", 255, 255, 255, 0.7],
"bg": ["background", 0, 0, 0, 0.4]
},
{
"class": "title_bar",
"attributes": ["file_dark"],
"bg": ["background", 255, 255, 255, 0.15]