Skip to content

Instantly share code, notes, and snippets.

View acro5piano's full-sized avatar
🏠
Working from home

Kay Gosho acro5piano

🏠
Working from home
View GitHub Profile
@buzztaiki
buzztaiki / rust-evdev-uinput-example.md
Last active July 21, 2023 13:25
Rust で evdev と uinput を使ってキーマッパーっぽい事をするメモ
@petrilli
petrilli / main.py
Last active January 5, 2024 19:50
Example combination of FastAPI and Pydantic with aiosql and aiosqlite
# -*- coding: utf-8 -*-
"""Example combination of FastAPI and Pydantic with aiosql and aiosqlite.
This module demonstrates the minimum viable integration approach for putting
together a few components:
- FastAPI. This provides a very high-performance and type-driving approach to
building APIs in Python
- Pydantic. A powerful data validation library.
- aiosql. Inspired by annosql and originally Clojure's yeSql, a way to programatically,
@rnyrnyrny
rnyrnyrny / alacritty.yml
Created May 20, 2021 03:42
my alacritty config file for win10 wsl2
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.

Keybase proof

I hereby claim:

  • I am Rudo2204 on github.
  • I am rudo2204 (https://keybase.io/rudo2204) on keybase.
  • I have a public key whose fingerprint is 4E50 E916 5AF3 72D5 F8E4 89B8 8F1B 9F11 8267 E3A1

To claim this, I am signing this object:

@iamcryptoki
iamcryptoki / curl_github_actions_workflow.txt
Created March 1, 2021 15:42
Run GitHub Actions Workflow using Curl (workflow_dispatch).
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <ACCESS_TOKEN_HERE>" \
https://api.github.com/repos/<ORG_OR_USERNAME>/<REPO>/actions/workflows/<FILENAME_OR_WORKFLOW_ID>/dispatches \
-d '{"ref":"refs/heads/master"}'
@sindresorhus
sindresorhus / esm-package.md
Last active April 19, 2024 10:56
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@startuml OAuth basic flow with auth code and access token
skinparam monochrome true
skinparam defaultFontSize 14
' plantuml: https://plantuml.com/sequence-diagram
' source: https://gist.github.com/hrchu/d88efb56e72534a1233d16f36eb3e3e9
title OAuth basic flow with auth code and access token
actor "You/Browser" as b
participant "slack.com" as s
@andrebrait
andrebrait / keychron_linux.md
Last active April 18, 2024 16:05
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.

@probonopd
probonopd / Wayland.md
Last active April 18, 2024 08:49
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@nestarz
nestarz / test_async_http.py
Created June 23, 2020 19:05
Async HTTP Client/Server Test with custom log
import asyncio
import http.server
import http.client
class LogHTTPHandler(http.server.SimpleHTTPRequestHandler):
log_file = open('access.log', 'w', 1)
def log_message(self, format, *args):
self.log_file.write(
f"{self.client_address[0]} - - [{self.log_date_time_string()}] {format % args}\n"