Skip to content

Instantly share code, notes, and snippets.

View j4ger's full-sized avatar

椰格 j4ger

  • 14:54 - 8h ahead
View GitHub Profile
@therealparmesh
therealparmesh / zed-vim-mode-cheatsheet.md
Created October 24, 2024 14:38
Zed vim mode cheatsheet

Zed Vim Mode Cheat Sheet

Zed's Vim mode replicates familiar Vim behavior while integrating modern features like semantic navigation and multiple cursors. This cheat sheet summarizes essential shortcuts and settings to help you navigate and edit code efficiently in Zed.


Enabling/Disabling Vim Mode

  • Enable/Disable Vim Mode: Open the command palette and use Toggle Vim Mode.
  • This updates your user settings: "vim_mode": true or false.
@jbwhit
jbwhit / example-ruff-formatting.ipynb
Last active May 4, 2025 00:37
Steps to use `ruff` in JupyterLab with the `jupyterlab_code_formatter` plugin.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lamperez
lamperez / cs35l41_spi.md
Last active April 20, 2025 14:37
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

Important

THIS IS NOW OBSOLETE WITH KERNEL VERSIONS ≥ 6.7.0

A recent announcement in the kernel mail list by Cirrus developers will solve the problem described here. Therefore, the proposed solutions will be soon obsolete. See this comment (thanks, @flukejones, for the tip).

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by

@davidedmundson
davidedmundson / PlasmaNested.sh
Last active June 14, 2025 02:47
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@QuentinN42
QuentinN42 / ocr
Created September 19, 2021 08:12
Automatic ocr with tesseract & flameshot
#!/usr/bin/env bash
TMPDIR=$(mktemp -d -t ocr-XXXXXXXXXX)
trap "rm -rf $TMPDIR" EXIT
cd "$TMPDIR"
flameshot gui -r > img.png
tesseract img.png text
cat text.txt | xsel --clipboard --input
@myyc
myyc / arch_linux_install_guide.md
Last active June 9, 2025 08:55
Arch Linux setup with all the good stuff (Plymouth, encryption, systemd-boot etc.)

I've used this guide through 2024 despite archinstall and it's still more or less valid. After having used archinstall twice and having encountered obscure issues (luksOpen taking ages, or slow reboots in general) I switched back to a manual setup and it seems to be almost as straightforward.

Always refer to the official guide in case of doubt.

First things first

One important thing first: the environment you will encounter on the live image is very different from what you'll end up installing, some things are significantly easier there: e.g. wifi tools come

@hadilq
hadilq / NixOS-guide.md
Last active June 11, 2025 07:41
Encypted LUKS LVM Btrfs Root with Opt-in State on NixOS

I'm trying to follow this guide to install NixOS using Btrfs, LUKS and LVM. The main usage of this page for me will be remembering what I did! My laptop is ASUS ROG GL553VD.

Just downloaded Plasma Desktop, 64bit and create a bootable Flash Drive. Then boot up to NixOS Live CD. Using gparted to create two partitions, One 200MB vfat EFI partittion and the rest of SSD drive will be an encrypted partition.

DISK=/dev/nvme0n1
@richardeoin
richardeoin / itm_en.rs
Last active September 22, 2022 13:28
Enable ITM output over the SWO pin for STM32H7 parts. The output is manchester coded and can be received by a debugger - eg. blackmagic probe
/// Enables ITM
///
/// If swo_enable is true, then the SWO output pin will be enabled
fn low_level_itm(dbgmcu: &stm32::DBGMCU, swo_enable: bool) {
// ARMv7-M DEMCR: Set TRCENA. Enables DWT and ITM units
unsafe { *(0xE000_EDFC as *mut u32) |= 1 << 24 };
// Ensure debug blocks are clocked before interacting with them
dbgmcu.cr.modify(|_, w| {
w.d1dbgcken()
@xabbu
xabbu / novpn.sh
Last active August 18, 2022 16:36 — forked from kriswebdev/novpn.sh
Bypass VPN for specific apps [Linux / OpenVPN]
#!/bin/bash
# === INFO ===
# NoVPN
# Description: Bypass VPN tunnel for applications run through this tool.
VERSION="2.0.0"
# Author: KrisWebDev
# Requirements: Linux with kernel > 2.6.4 (released in 2008).
# traceroute
# libcgroup (AUR)