Skip to content

Instantly share code, notes, and snippets.

View pgaskin's full-sized avatar
💭
I may be slow to respond (especially for Kobo stuff).

Patrick Gaskin pgaskin

💭
I may be slow to respond (especially for Kobo stuff).
View GitHub Profile
@pgaskin
pgaskin / TapoC100.md
Last active July 28, 2025 02:10
TP-Link Tapo C100 notes

TP-Link Tapo C100

Overview

I've tried v4.20 and v5.0 hardware revisions.

The v5.0 ones seem a bit more responsive in general, though it's unclear if it's due to firmware or hardware. The v5.0 one does talk out loud when setting it up.

For both versions, recent firmware updates have significantly improved the reliability.

// Command i3-multi-input sends input to all selected i3wm windows. It is
// intended to be bound to a keyboard shortcut.
//
// bindsym --release $mod+Shift+a exec --no-startup-id i3-multi-input
package main
import (
"fmt"
"iter"
"os"
/* last updated for ff 134 */
/* toolkit.legacyUserProfileCustomizations.stylesheets = true */
/* compact mode:
browser.compactmode.show = true
extensions.activeThemeID = [email protected]
browser.uidensity = 1
browser.tabs.inTitlebar = 0
*/
package jsonx
import (
"strconv"
"unicode/utf8"
)
// AppendKey appends a JSON key to an object, adding a comma if necessary.
func AppendKey(e []byte, k string) []byte {
if len(e) == 0 {
for x in /data/android/lineage/vendor/google/caiman/proprietary/product/etc/CarrierSettings/*_ca.pb; do protoc -I ~/src/apnstuff/android14-qpr3-release/ ~/src/apnstuff/android14-qpr3-release/carrier_settings.proto --decode com.google.carrier.CarrierSettings < $x > $(basename $x | sed s/.pb/.txt/g); done
protoc -I ~/src/apnstuff/android14-qpr3-release/ ~/src/apnstuff/android14-qpr3-release/carrier_list.proto --decode com.google.carrier.CarrierList < /data/android/lineage/vendor/google/caiman/proprietary/product/etc/CarrierSettings/carrier_list.pb > x_carrier_list.txt
#!/bin/bash
set -euo pipefail
process() {
local adb_addr pair_code pair_addr vars="$(
set -euo pipefail
magick "$1" -white-threshold 30% -black-threshold 20% PNG:- |
tesseract --psm 3 stdin stdout |
sed -E 's/^\w\s//' |
tr '\n' '#' |
@pgaskin
pgaskin / soundcore-p20i-gaming-mode.go
Last active July 7, 2024 15:01
Controlling the Anker Soundcore P20i gaming mode (i.e., low latency mode) on Linux.
package main
import (
"encoding/hex"
"net"
"os"
"golang.org/x/sys/unix"
)
@pgaskin
pgaskin / reconcile_branches.sh
Created May 10, 2024 21:33
Creates a synthetic merge commit from scratch out of the specified branches, then adds it to the history of the current branch. Used to maintain https://github.com/pgaskin/cmus.
#!/bin/bash
set -e
# our script name
self="_exp_reconcile_branches.sh"
# check the args
if [[ $# -eq 0 ]]
then
echo "creates a synthetic merge commit from scratch out of the specified branches, then adds it to the history of the current branch"
#include "pico/stdlib.h"
#include "hardware/i2c.h"
#include "fnk0079.h"
int main() {
i2c_init(i2c0, 100 * 1000);
gpio_set_function(4, GPIO_FUNC_I2C);
gpio_set_function(5, GPIO_FUNC_I2C);
gpio_pull_up(4);
gpio_pull_up(5);
/* ==UserStyle==
@name Compact Outlook.com Calendar
@version 20240124.13.32
@namespace ?
==/UserStyle== */
@-moz-document url-prefix("https://outlook.office.com/calendar/view/week"), url-prefix("https://outlook.office.com/calendar/view/workweek"), url-prefix("https://outlook.office.com/calendar/view/day") {
/* collapse global nav unless hovering over edge */
#appContainer:not(:hover:not(:has(* >#MainModule:hover))) {
:has(> #MainModule) {