This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Read on GitHub RSS | |
// @namespace gh-rss.hyrious.me | |
// @match https://github.com/*.atom | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Because github new dashboard is terrible. | |
// ==/UserScript== | |
(async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitHub Shorten Commit URL | |
// @namespace short-commit.github.com | |
// @match https://github.com/**/commit/* | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Replace shorter URL if abbrev commit hash exist | |
// ==/UserScript== | |
void function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>Stroke Test</title> | |
<style> | |
* { box-sizing: border-box; } | |
body { margin: 0; } | |
.container { | |
position: absolute; | |
inset: 50px 100px; | |
border: 1px solid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import json | |
from collections import OrderedDict | |
# https://github.com/antfu/eslint-config/blob/main/src/configs/sort.ts | |
KeyOrder = [ | |
'publisher', | |
'name', | |
'displayName', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file persists Loro doc to indexeddb | |
import type { Loro, LoroEvent } from 'loro-crdt' | |
import { Remitter, ReadonlyRemitter } from 'remitter' | |
import * as idb from 'lib0/indexeddb' | |
export interface PersistEventData { | |
synced: IPersistProvider | |
} | |
export interface IPersistProvider { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("dup", async () => { | |
if (fs.existsSync("pnpm-lock.yaml")) { | |
const { packages } = yaml.load(fs.readFileSync("pnpm-lock.yaml", "utf8")); | |
let last = ["", ""]; | |
let seen = new Set(); | |
const log = (s) => seen.has(s) || (seen.add(s), console.log(s)); | |
for (const path in packages) { | |
const i = path.lastIndexOf("@"); | |
const pkg = path.slice(1, i); | |
const ver = path.slice(i + 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitHub PDF Raw Link | |
// @namespace raw-pdf.github.hyrious.me | |
// @match https://github.com/* | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Replace PDF file's link with its raw link | |
// @require https://cdn.jsdelivr.net/npm/selector-set@1.1.5/selector-set.js | |
// @require https://cdn.jsdelivr.net/npm/selector-observer@2.1.6/dist/index.umd.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -shared -Os -s -o a.dll -m32 mouse-wheel.c | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
HHOOK hook; | |
DWORD delta; | |
LRESULT CALLBACK LowLevelMouseProc(_In_ int nCode, _In_ WPARAM wParam, _In_ LPARAM lParam) { | |
if (wParam == WM_MOUSEWHEEL) { | |
MSLLHOOKSTRUCT *mouse = (MSLLHOOKSTRUCT *)lParam; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Who Starred Me - GitHub RSS | |
// @namespace star-rss.hyrious.me | |
// @match https://github.com/*.private.atom | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Because refined github hides them. | |
// ==/UserScript== | |
(async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Wall -Wextra -pedantic -Wimplicit-fallthrough -Wsequence-point -Wswitch-default -Wswitch-unreachable -Wswitch-enum -Wstringop-truncation -Wbool-compare -Wtautological-compare -Wfloat-equal -Wshadow=global -Wpointer-arith -Wpointer-compare -Wcast-align -Wcast-qual -Wconversion -Wwrite-strings -Wdangling-else -Wlogical-op |