Skip to content

Instantly share code, notes, and snippets.

@fortuna
fortuna / merge_results.tsv
Last active July 13, 2024 23:45
Analysis of blocking in Russia. All entries in one table.
strategy server_net server_port isp url_scheme exit_code img error
$key Digital Ocean 443 Bee Line Cable http 0
$key Digital Ocean 443 Bee Line Cable https 0
$key Digital Ocean 443 MTS PJSC http 28 curl: (28) Operation timed out after 10006 milliseconds with 0 bytes received
$key Digital Ocean 443 MTS PJSC https 28 curl: (28) Connection timed out after 10005 milliseconds
$key Digital Ocean 443 PJSC MegaFon http 0
$key Digital Ocean 443 PJSC MegaFon https 56 curl: (56) Failure when receiving data from the peer
$key Digital Ocean 443 Tele2 Russia http 0
$key Digital Ocean 443 Tele2 Russia https 0
$key Digital Ocean 5555 Bee Line Cable http 0
@andrebrait
andrebrait / keychron_linux.md
Last active July 14, 2024 10:31
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@CAFxX
CAFxX / golang_minimize_allocations.md
Last active July 13, 2024 05:32
Minimize allocations in Go

📂 Minimize allocations in Go

A collection of tips for when you need to minimize the number of allocations in your Go programs.

Use the go profiler to identify which parts of your program are responsible for most allocations.

⚠️ Never apply these tricks blindly (i.e. without measuring the actual performance benefit/impact). Most of these tricks cause a tradeoff between reducing memory allocations and other aspects (including e.g. higher peak memory usage, higher CPU usage, lower maintainability, higher probability of introducing subtle bugs). Only apply these tricks if the tradeoff in every specfic case is globally positive.

Protobuf