Skip to content

Instantly share code, notes, and snippets.

View tkit1994's full-sized avatar

Hao Cheng tkit1994

View GitHub Profile
CXX=g++
COMMON_FLAGS=-std=c++23 -Wall -Wextra -Wpedantic
# Detect OS
UNAME_S := $(shell uname -s)
# Set debug flags based on OS
ifeq ($(UNAME_S),Linux)
DEBUG_FLAGS=-g -O0 -fno-omit-frame-pointer -fsanitize=address
DEBUG_LDFLAGS=-fsanitize=address
@tkit1994
tkit1994 / delete_all_workflows.sh
Created January 4, 2023 08:49
delete all workflows
#!/bin/bash
PAGER=cat
gh run list --json databaseId -q '.[].databaseId' --limit 1000 |
xargs -IID gh api \
"repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/actions/runs/ID" \
-X DELETE
@tkit1994
tkit1994 / yt-dlp.sh
Created December 5, 2022 09:59
yt-dlp
#!/bin/bash
yt-dlp $1 \
--write-auto-subs \
--write-subs \
--write-thumbnail \
--throttled-rate 700k \
-P temp:/tmp home:$PWD \
-o "videos/%(uploader)s/%(playlist_autonumber)s-%(title)s-%(id)s.%(ext)s"
// ==UserScript==
// @name fucking-carl
// @version 0.0.1
// @description A userscript to bypass programmingcarl.com's block
// @author HaoCheng <[email protected]>
// @namespace com.github.tkit1994
// @license MIT
// @homepage https://github.com/tkit1994/fucking-carl
// @updateURL https://gist.github.com/tkit1994/79fbe8adf841e8899b605c511b34ffd2/raw/fucking-carl.user.js
// ==UserScript==
// @name LeetcodeCopy
// @version 1.0.1
// @description Add a copy button in leetcode.cn's editor to copy code in vim mode
// @author HaoCheng
// @namespace com.github.tkit1994
// @license MIT
// @homepage https://github.com/tkit1994/leetcode-copy
// @updateURL https://gist.github.com/tkit1994/cace80dfd3487af8ff6e43061b54e5db/raw/leetcode-copy.user.js
@tkit1994
tkit1994 / fucking-labuladong.userscipt.js
Created May 3, 2022 10:16
a script to bypass labuladong's block
// ==UserScript==
// @name fucking-labuladong
// @namespace http://tampermonkey.net/
// @version 0.1
// @description a script to bypass labuladong's block
// @author tkit
// @match https://labuladong.gitee.io/*
// @match https://labuladong.github.io/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gitee.io
// @grant none
@tkit1994
tkit1994 / config.toml
Created February 18, 2022 08:36
containerd configruation
disabled_plugins = []
imports = []
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
version = 2
[cgroup]
@tkit1994
tkit1994 / init.gradle
Last active May 8, 2021 13:48
Gradle 使用aliyun maven mirror.
allprojects{
repositories {
def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/public/'
def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter/'
def ALIYUN_GOOGLE_URL = 'https://maven.aliyun.com/repository/google/'
def ALIYUN_GRADLE_PLUGIN_URL = 'https://maven.aliyun.com/repository/gradle-plugin/'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2/')) {
@tkit1994
tkit1994 / OmegaOptions.bak
Created April 24, 2018 13:15
OmegaOptionsBackUp
{"+__ruleListOf_shadowsocks-auto":{"color":"#7c05ae","defaultProfileName":"direct","format":"AutoProxy","lastUpdate":"2018-04-24T13:08:17.176Z","matchProfileName":"shadowsocks","name":"__ruleListOf_shadowsocks-auto","profileType":"RuleListProfile","revision":"15f70dc85d2","ruleList":"[AutoProxy 0.2.9]\n! Checksum: /saaHfCS3OhjBlUuM4nUoQ\n! Expires: 6h\n! Title: GFWList4LL\n! GFWList with EVERYTHING included\n! Last Modified: Tue, 24 Apr 2018 09:01:39 -0400\n!\n! HomePage: https://github.com/gfwlist/gfwlist\n! License: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt\n!\n! GFWList is unlikely to fully comprise the real\n! rules being deployed inside GFW system. We try\n! our best to keep the list up to date. Please\n! contact us regarding URL submission / removal,\n! or suggestion / enhancement at issue tracker:\n! https://github.com/gfwlist/gfwlist/issues/.\n\n!---------403/451/520 & URL Redirects---------\n||2dbook.com\n||4tern.com\n!--ehentai\n|http://85.17.73.31/\n||adorama.com\n||agnesb.fr\n||akiba-