Skip to content

Instantly share code, notes, and snippets.

View levihuayuzhang's full-sized avatar

Huayu Zhang levihuayuzhang

View GitHub Profile
@bitterteasweetorange
bitterteasweetorange / keybindings.json
Last active September 9, 2024 13:49
setup vscode like neovim
[
{
"command": "projectManager.listGitProjects#sideBarGit",
"key": "cmd+o"
},
{
"command": "expand_region",
"key": "ctrl+=",
"when": "editorTextFocus"
},
@levihuayuzhang
levihuayuzhang / fix-DSD-thinkBook-16p-g4-IRH-linux-6.7.0-rc2.patch
Last active September 7, 2024 14:42
Workaround for Lenovo Thinkbook 16p Gen4 IRH sound issue (Should be fixed in Linux v6.8 or later)
From 86d1cc3e8e024c6776424f09108030fabe67cf5f Mon Sep 17 00:00:00 2001
From: Huayu Zhang <xxxxxxxxx@qq.com>
Date: Thu, 11 Jan 2024 16:18:29 +0800
Subject: [PATCH] add _DSD for SSID 0x17aa38a9 and 38ab (ThinkBook 16p G4 IRH)
the dmseg has following output after patching:
[ 4.401426] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[ 4.455038] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[ 6.362589] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: CS35L41 Bound - SSID: 17AA38A9, BST: 1, VSPK: 1, CH: L, FW EN: 1, SPKID: 0
@dbrookman
dbrookman / build-mpv_silicon.sh
Last active September 17, 2024 19:09
How to build mpv & mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
@progrium
progrium / README.md
Last active August 20, 2024 22:33
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

@akillcool
akillcool / clash.service
Last active April 19, 2024 12:27
clash auto start and update subcribe configuration
# edit and save this file to /usr/lib/systemd/system/clash.service
[Unit]
Description=clash
After=network.target
[Service]
WorkingDirectory="your home directory"/.config/clash
ExecStart="your home directory"/.config/clash/start-clash.sh
ExecStop="your home directory"/.config/clash/stop-clash.sh
Environment="HOME=your home directory"
@Brainiarc7
Brainiarc7 / conky-setup-clevo-p751dm2-g.md
Last active February 21, 2024 09:24
My Conky configuration

Setting up Conky on Ubuntu 16.04LTS for the Clevo P751DM2-G

System Information:

We extract this with inxi:

installation:

sudo apt-get install inxi
@mishurov
mishurov / syntax.s
Last active August 31, 2024 06:57
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code