Skip to content

Instantly share code, notes, and snippets.

View Yukaii's full-sized avatar
👾
nyan, nyan, nyan

Yukai Huang Yukaii

👾
nyan, nyan, nyan
View GitHub Profile
@Illyism
Illyism / custom-rules.js
Last active April 2, 2025 15:40
ESLint 200-Line Max File Size Rule for Better AI Coding
/**
* 🧠 My game-changing ESLint rule that makes AI coding 10x better:
* - Enforces 200-line max file size
* - Counts only actual code (ignores comments)
* - Gives helpful refactoring suggestions
* - Works perfectly with Cursor AI's "Fix in Chat"
*
* Custom ESLint rule to limit file size to 200 lines
* @type {import("eslint").Rule.RuleModule}
*/
@stanley2058
stanley2058 / ui-class-debugger.user.js
Last active April 8, 2025 04:56
Highlight all `ui-` class on a web page
// ==UserScript==
// @name HackMD `ui-` classes highlighter
// @namespace http://hackmd.io/
// @version 0.1.2
// @description Show all `ui-` classes
// @author stanley2058, Yukaii
// @match https://hackmd.io/*
// @match https://local.localhost/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=hackmd.io
// @grant GM.getValue
@devnoname120
devnoname120 / macos_docker_xorg_forwarding.md
Last active April 14, 2025 05:14
Xorg/X11 forwarding on macOS and docker

Xorg/X11 forwarding on macOS and docker

In order to run Xorg apps on macOS you will need to install xquartz:

brew install --cask --no-quarantine xquartz

And then configure it

@Yukaii
Yukaii / README.md
Last active February 14, 2025 17:06
Automated script for launching and retrying Oracle Cloud's Always-Free Tier instance with logging functionality

Script to Launch Always-Free Tier Machine on Oracle Cloud

The instance resource is often at full capacity. Therefore, we should create a script to automatically retry launching the instance at regular intervals.

The script also includes basic logging and will stop launching once you have successfully launched the instance.

Prerequisites

  • jq
  • oci (with correct setup)
@Yukaii
Yukaii / README.md
Last active May 6, 2024 16:15
g0v logbot simple navigation userscript

g0v logbot simple navigation userscript

Add the bottom right buttons for more sensible navigation.

スクリーンショット 2024-05-07 夜中12 14 08

Installation

Install Greasemonkey

@stephancasas
stephancasas / toggle-do-not-disturb-ventura.jxa.js
Last active March 5, 2025 04:31
Toggle Do Not Disturb Ventura AppleScript
#!/usr/bin/env osascript -l JavaScript
/**
* -----------------------------------------------------------------------------
* Toggle Do Not Disturb Mode from Control Center
* -----------------------------------------------------------------------------
*
* Created on May 18, 2023 by Stephan Casas
*
* Options:
@gsuuon
gsuuon / colors.lua
Last active January 3, 2025 03:01
My styled wezterm config - just the relevant bits
local wezterm = require 'wezterm'
local color_default_fg_light = wezterm.color.parse("#cacaca") -- 💩
local color_default_fg_dark = wezterm.color.parse("#303030")
return {
VERIDIAN = {
bg = wezterm.color.parse("#4D8060"),
fg = color_default_fg_light
},
@asportnoy
asportnoy / q.fish
Last active May 9, 2023 20:02
GitHub Copilot CLI for Fish Shell
# Requires the GitHub Copilot CLI from GitHub Next
# https://www.npmjs.com/package/@githubnext/github-copilot-cli#installation-and-setup
# This needs to be set up as a function in your fish config. You can use `funced -s q` to do this.
# Options:
# q -g --git: Use github-copilot-cli git-assist
# q -h --gh: Use github-copilot-cli gh-assist
# Defaults to using what-the-shell (general command assist) if neither option is provided
# Completions for your Fish config:
@LintaoAmons
LintaoAmons / .tmux.conf
Created October 8, 2022 09:50
Popup terminal with tmux
# ... your other config
bind-key -n M-3 run-shell 'toggle-tmux-popup'
# you can switch `M-3` to any keybindings you like.
@Christopher-Hayes
Christopher-Hayes / slack-bolt.md
Last active December 23, 2024 10:45
Building a Serverless SlackBot with Bolt on Vercel - Things to Know

2024 Edit - In the comments, there are good alternatives. When this gist was written, there were few alternatives to the Slack Bolt package.

Some gotchas from my recent experience of building a serverless Next.JS + Bolt.JS Slack App on Vercel.

Note that if you're building an app that you want to distribute to other workspaces, AFAIK you need to build an API. So, Next.JS is used here to help with the public API. The alternative to an API is using "socket mode".

Slack API with Bolt must use /slack/events endpoint

  • When building out the API, Bolt ONLY uses the /slack/events endpoint. The Slack config settings will suggest you provide a different endpoint, like /slack/commands for Slash Commands. That would work if you weren't using the Node API (via Bolt), such as the Python API. However, Bolt uses the Node API which ONLY uses /slack/events for everything. You can still use Bolt functions app.command() and similar, just remember to put the /slack/events endpoint in the Slack config.