Skip to content

Instantly share code, notes, and snippets.

View aiyogg's full-sized avatar
🎯
Focusing

Chuck aiyogg

🎯
Focusing
View GitHub Profile
@aiyogg
aiyogg / rename-committer.sh
Created February 26, 2025 10:21
modify the comminter
#!/bin/bash
git filter-branch --force --env-filter '
# get the old email from the first argument
OLD_EMAIL="OLD_EMAIL"
CORRECT_NAME="CORRECT_NAME"
CORRECT_EMAIL="CORRECT_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
@aiyogg
aiyogg / wework-sso.js
Last active November 27, 2024 08:27
Wechat Work SSO
// ==UserScript==
// @name 一键 SSO 登录
// @namespace http://tampermonkey.net/
// @version 2024-10-14
// @description 在企业微信中点击接收到 BOT 的链接后,自动完成扫码登录
// @author Chuck
// @match https://sso.exmaple-company-internal.com/login.html?*
// @match https://sso.exmaple-company-external.com/login.html?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=work.weixin.qq.com
// @grant GM_xmlhttpRequest
@aiyogg
aiyogg / usePromise.tsx
Created April 9, 2024 03:23
React use Promise
import React from "react"
import type { ReactNode } from "react"
const { createContext, useContext, useRef, useState } = React;
type PromiseCanUse<T> = Promise<T> & {
status?: 'pending' | 'fulfilled' | 'rejected'
reason?: unknown
value?: T
}
@aiyogg
aiyogg / default.custom.yaml
Last active January 16, 2025 10:39
Rime config
patch:
# 方案列表
schema_list:
# 可以直接删除或注释不需要的方案,对应的 *.schema.yaml 方案文件也可以直接删除。
# - schema: rime_ice # 雾凇拼音(全拼)
# - schema: double_pinyin # 自然码双拼
# - schema: double_pinyin_abc # 智能 ABC 双拼
# - schema: double_pinyin_mspy # 微软双拼
# - schema: double_pinyin_sogou # 搜狗双拼
- schema: double_pinyin_flypy # 小鹤双拼
@aiyogg
aiyogg / .eslintrc.json
Created January 15, 2018 05:59
ESLint global configure
{
"extends": "standard",
"plugins": [
"standard",
"promise"
],
"env": {
"node": true,
"mocha": true,
"es6": true,