Skip to content

Instantly share code, notes, and snippets.

View yuhangch's full-sized avatar
🚶
exhausted

陈昱行|Chen Yu-hang yuhangch

🚶
exhausted
View GitHub Profile
@yuhangch
yuhangch / obsidian-journals.js
Created July 3, 2024 09:42
Obsidian journals archived in YYYY/MM/YYYY-MM-DD format
// 90% writen by copilot
import fs from 'fs'
import path from 'path'
const ob_vault_path = "path/to/journals/"
const all_journal_files = fs.readdirSync(ob_vault_path).filter(file => file.endsWith('.md'))
all_journal_files.forEach(file => {
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
@yuhangch
yuhangch / start-page.config.js
Last active May 17, 2023 01:10
start-page-config
{
"username": "yuhangch",
"theme": {
"backgroundColor": "#121317",
"windowColor": "#1e212b",
"glowColor": "#6b5cb157",
"white": "#e2e2e2",
"gray": "#97989d",
"black": "#16161e",
"red": "#ec6183",
@yuhangch
yuhangch / gasnow.10s.sh
Last active March 24, 2023 07:40
SwiftBar ETH gas price
#!/bin/bash
# <xbar.title>ETH Gas Price</xbar.title>
# <xbar.version>v2.0.1</xbar.version>
# <xbar.author>Biran Yucel</xbar.author>
# <xbar.author.github>biranyucel</xbar.author.github>
# <xbar.desc>ETH GasPrice forecast system.</xbar.desc>
# <xbar.image>https://i.imgur.com/f1hPKO2.png</xbar.image>
# <xbar.abouturl>https://ethgasstation.info/</xbar.abouturl>
#
@yuhangch
yuhangch / header-editor-config.json
Last active August 31, 2023 03:42
cn.bing redirect to www.bing
{
"request": [
{
"enable": true,
"name": "bing-cn-to-www",
"ruleType": "redirect",
"matchType": "prefix",
"pattern": "https://cn.bing.com",
"exclude": "",
"group": "bing-redirect",
@yuhangch
yuhangch / Applications.tree
Last active January 11, 2023 09:04
Mac App list
├── Anki.app
├── ApiPost7.app
├── AppCleaner.app
├── AuroraEditor.app
├── BaiduNetdisk_mac.app
├── Bear.app
├── Brave Browser.app
├── ClashX.app
├── CodeEdit.app
├── DiffusionBee.app
@yuhangch
yuhangch / option-character-replace.json
Created November 8, 2022 07:45
option + qwertyuiop to !@#$%^&*()
{
"title": "optional-symbol-replace",
"rules": [
{
"description": "option + qwertyuiop to shift + 1234567890",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "q",
@yuhangch
yuhangch / .ideavimrc
Last active January 11, 2023 09:03
Jetbrains IDEs ideavimrc
let mapleader = ";"
set relativenumber
set number
set easymotion
set showmode=true
set ideajoin
set ic
" set noic
set hls
@yuhangch
yuhangch / mpv-open-directory.reg
Created April 26, 2022 14:07
mpv open directory
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\background\shell\mpv]
@="Play all with mpv"
[HKEY_CLASSES_ROOT\Directory\background\shell\mpv\command]
@="\"C:\\Program Files\\mpv\\mpv.exe\" \"%V\\*\""
[HKEY_CLASSES_ROOT\Directory\shell\mpv]
@="Play all with mpv"
@yuhangch
yuhangch / ef-core-pg-command-is-already-in-progress.cs
Last active March 20, 2022 12:44
EF Core / Postgresql LINQ command is already in progress
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
builder.Services.AddDbContext<TestDb>(options =>