Skip to content

Instantly share code, notes, and snippets.

@madushan1000
madushan1000 / zmk_split_battery_level_linux.py
Created January 16, 2024 22:25
See battery levels of a zmk split ble keyboard on linux
from dbus_next.aio import MessageBus
from dbus_next.constants import BusType
import asyncio
BLUEZ = "org.bluez"
#replace hci0 with your bluetooth adapter name and FF_FF_FF_FF_FF_FF with your keyboard address
BLUEZ_PATH = "/org/bluez/hci0/dev_FF_FF_FF_FF_FF_FF"
GATT_SERVICE = 'org.bluez.GattService1'
GATT_CHARACTERISCITC = 'org.bluez.GattCharacteristic1'
GATT_CHARACTERISCITC_DESCR = 'org.bluez.GattDescriptor1'
BATTERY_UUID = "0000180f-0000-1000-8000-00805f9b34fb"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; BACK UP YOUR LOGSEQ DIR BEFORE RUNNING THIS!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright (C) Aug 4 2022, William R. Burdick Jr.
;;
;; LICENSE
;; This code is dual-licensed with MIT and GPL licenses.
@vindarel
vindarel / common-lisp-VS-clojure.md
Last active October 30, 2025 07:16
Notes on Common Lisp VS Clojure

Testimonies

CL's compiler

The thing in CL I miss most doing Clojure as my day job? CL's compiler. I like having a compiler tell me at compile time about the mistakes I've made. Bogus arguments. Unreachable code because of unhandled exceptions, and so on. CL saves me round after round of bugs that in clojure aren't found until you run the code. If you test well, it's found when testing, if you don't it's found in production. "Clojure compiler" almost demands air quotes.

CL's optional but oh-so-useful model of type declarations is also infinitely more useful (to me) than Clojure's use of "spec", and instrumentation that happens only at test time because of the cost. Depending on the OPTIMIZE declarations, other type defs are a floor wax and dessert topping. Want checks for argument types? Lower optimizations. Want most efficient machine code? High optimizations.

/u/Decweb, March 2023 https://www.reddit.com/r/lisp/comments/11ttnxk/the_rise_fall_of_lisp_too_good_for_the_rest_of/jczpysp/

@rcarmo
rcarmo / bt-agent.service
Last active December 3, 2025 03:58
Set up PAN networking on Raspbian Stretch (use sudo to create these files and run all commands)
# in /etc/systemd/system
[Unit]
Description=Bluetooth Agent
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple
[Install]
WantedBy=multi-user.target
@troggy
troggy / drebedengiToLedger.js
Created August 19, 2018 11:24
Drebedengi to Ledger conversion (very rough)
const fs = require('fs');
const worker = async (filename) => {
console.log(`Reading ${filename}`);
fs.readFile(filename, (err, data) => {
if (err) throw err;
const lines = data.toString().split('\n');
const currencies = {};
const accounts = {};
const openingBalances = [];
@styblope
styblope / docker-api-port.md
Last active October 4, 2025 17:37
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@marcusramberg
marcusramberg / -
Last active February 19, 2025 14:08
kitty.conf including nord color theme
# vim:fileencoding=utf-8:ft=conf
# Fully featured
font_family FuraCode Nerd Font Mono
italic_font auto
bold_font auto
bold_italic_font auto
# Font size (in pts)
font_size 11.0
@SG60
SG60 / nix.fish
Last active January 17, 2022 08:58
Nix path setup file for fish (based on the bash version)
if [ -n "$HOME" ]
set NIX_LINK "$HOME/.nix-profile"
# Set the default profile.
if not [ -L "$NIX_LINK" ]
echo "creating $NIX_LINK" >&2
set _NIX_DEF_LINK /nix/var/nix/profiles/default
/nix/store/rznhi2hyzcgckk7yb2662lr57sb906ps-coreutils-8.24/bin/ln -s "$_NIX_DEF_LINK" "$NIX_LINK"
end
@jjnilton
jjnilton / mac-network-commands-cheat-sheet.md
Last active October 20, 2025 23:48
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@Jacketbg
Jacketbg / fetch_inoreader_starred_articles
Created April 27, 2015 12:46
Fetch your Inoreader starred articles
<?php
/*
This script exports user's starred articles via the official Inoreader API.
Use it in case you have thousands of starred articles since Inoreader's export function will not export much more than 1000 articles.
Use your Inoreader email and password to sign in.
You will need to create a developer application first to obtain $app_id and $app_key. Read here about this - http://www.inoreader.com/developers/register-app
*/
$email = ""; // You Inoreader username or email
$password = ""; // Your Inoreader password