Skip to content

Instantly share code, notes, and snippets.

View yuhangch's full-sized avatar
🚶
exhausted

陈昱行|Chen Yu-hang yuhangch

🚶
exhausted
View GitHub Profile

Important

DO NOT USE VSCODE terminal and make sure uname -m returns arm64

  1. First Install Xcode command line tool
xcode-select --install
  1. Create and change /opt directories owner
@EliCDavis
EliCDavis / main.go
Created September 15, 2020 20:29
Find Windows Handle Of Application In Golang
package main
import (
"fmt"
"log"
"syscall"
"unsafe"
)
var (
@rikumi
rikumi / iconsur.sh
Last active October 24, 2023 06:46
My personal iconsur setup
# See https://github.com/rikumi/iconsur
yarn global add iconsur
sudo iconsur set /Applications/Android\ File\ Transfer.app -k Airdroid
sudo iconsur set /Applications/Android\ Studio.app/ -l -c 7a5 -s 0.8
sudo iconsur set /Applications/DaisyDisk.app/ -l
sudo iconsur set /Applications/Decompressor.app/ -l
sudo iconsur set /Applications/Discord.app/
sudo iconsur set /Applications/Google\ Chrome.app/
sudo iconsur set /Applications/IINA.app/ -l -c 161d22
@Aneureka
Aneureka / sync-from-chrome-to-safari
Last active November 4, 2023 13:13
An apple script to sync history, bookmarks & passwords from google chrome to safari.
# Add a scheduled sync task at 4:00 am
# Some privileges should be granted to `cron` *manually*, so you may test `* * * * *` (run every second) first to grant the needed privileges in advance
0 4 * * * osascript /path/to/your/sync-from-chrome-to-safari.scpt
@troyfontaine
troyfontaine / 1-setup.md
Last active May 3, 2024 10:52
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@tanyuan
tanyuan / smart-caps-lock.md
Last active May 3, 2024 08:19
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@bendc
bendc / random-color.js
Last active February 7, 2024 03:19
Generate nice random colors
const randomColor = (() => {
"use strict";
const randomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
return () => {
var h = randomInt(0, 360);
var s = randomInt(42, 98);