Skip to content

Instantly share code, notes, and snippets.

View zhiyue's full-sized avatar
🌻
just do it.

zhiyue zhiyue

🌻
just do it.
View GitHub Profile
@zhiyue
zhiyue / atuin.zsh
Created April 3, 2025 10:59 — forked from nikvdp/atuin.zsh
Use atuin to power ctrl-r history search but with fzf. Also disable atuin's up arrow bindings and use ctrl-e to bring up atuin's own tui
# make sure you have `tac` [1] (if on on macOS) and `atuin` [2] installed, then drop the below in your ~/.zshrc
#
# [1]: https://unix.stackexchange.com/questions/114041/how-can-i-get-the-tac-command-on-os-x
# [2]: https://github.com/ellie/atuin
atuin-setup() {
! hash atuin && return
bindkey '^E' _atuin_search_widget
export ATUIN_NOBIND="true"
@zhiyue
zhiyue / windsurf-meta-workflow-prompt
Created April 3, 2025 07:10 — forked from entrepeneur4lyf/windsurf-meta-workflow-prompt
Windsurf Memory Bank & Meta Workflow Promt
# Windsurf Memory System: Advanced Coding Assistant
I am Windsurf, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This drives me to maintain perfect documentation through the Windsurf Memory System. After each reset, I rely ENTIRELY on my Memory Bank to understand projects and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
## Core Identity and Operating Principles
1. **Memory-Driven Architecture**: After each reset, you MUST read ALL memory bank files to regain context.
2. **Documentation Excellence**: Maintain impeccable records as your future self depends entirely on them.
3. **Rigorous Performance Standards**: Never compromise on quality standards or evaluation criteria.
4. **Structured Problem-Solving**: Follow defined workflows and methodologies for all tasks.
@zhiyue
zhiyue / wsl2-with-1password-info.md
Created December 20, 2024 12:29 — forked from WillianTomaz/wsl2-with-1password-info.md
Instructions for using 1Password SSH Agent with WSL2 (on Windows 11)

LinkedIn

Saturday, April 22, 2023

How to Use 1Password SSH Agent with WSL2 (on Windows 11)

  • Note:

    • Always look for the official documentation, this tutorial may not suit you as there are new updates to the installation process.
    • References are at the end of the document.
  • Was used:

@zhiyue
zhiyue / New-DevDrive.ps1
Created October 14, 2024 11:47 — forked from lawndoc/New-DevDrive.ps1
Scripted Dev Drive Setup
<#
.SYNOPSIS
Script to create a new Dev Drive
.DESCRIPTION
This script will create a new Dev Drive on a Windows system. By default, it will create a 100GB dynamically sized VHDX file located in C:\ProgramData\Custom Dev Drive\drive.vhdx that will be mounted to the V: letter drive. For more information about Dev Drives, please see https://learn.microsoft.com/en-us/windows/dev-drive/
.EXAMPLE
.\New-DevDrive.ps1
@zhiyue
zhiyue / README.md
Created September 4, 2023 04:36 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

{
echo "Loaded kernel extensions:";
kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}';
echo $'\n'"Loaded user agents:";
launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}';
echo $'\n'"Inserted libraries:";
launchctl getenv DYLD_INSERT_LIBRARIES;
echo $'\n'"User cron tasks:";
crontab -l;
echo $'\n'"System launchd configuration:";
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)
@zhiyue
zhiyue / zhHans.conf.ini
Created August 29, 2023 16:30 — forked from kang000feng/zhHans.conf.ini
surge conf 配置详细说明
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)
@zhiyue
zhiyue / cloudflare-worker-proxy.js
Created June 20, 2023 02:08 — forked from noobnooc/cloudflare-worker-proxy.js
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@zhiyue
zhiyue / build.bat
Created May 11, 2023 10:08
bash to bat
@echo off
setlocal EnableDelayedExpansion
set process_name=%1
cd %process_name%
call :compile
call :make_output