Skip to content

Instantly share code, notes, and snippets.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
"DisableSearchBoxSuggestions"=dword:00000001
@okayurisotto
okayurisotto / revert-contextmenu.reg
Last active May 8, 2024 07:11
Windows 11の右クリックメニューをWindows 10時代の見た目・機能に戻すためのレジストリエントリを登録するファイル
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32]
@=""
export function* separate(
data: Uint8Array,
bitLength: number
): Generator<number> {
let bufferBitLength = 0;
let buffer = 0;
for (const chunk of data) {
bufferBitLength += 8;
buffer = (buffer << 8) | chunk;
type Seq<T extends number, V extends number[] = []> = V["length"] extends T
? V
: Seq<T, [...V, V["length"]]>;
type Add<T extends number, U extends number> = [...Seq<T>, ...Seq<U>]["length"];
type Sub<
T extends number,
U extends number,
V extends never[] = []
class Software {
local Semver = (str: String) ->
str.matches(Regex(#"^\#(IntStr)\.\#(IntStr)\.\#(IntStr)$"#))
local IntStr = #"(0|[1-9]\d*)"#
local function greet(name: String): String = "Hello, \(name) world!"
name: String(length > 0)
version: String(Semver)
message: String = greet(name)
@okayurisotto
okayurisotto / xml-peg
Created February 2, 2024 11:47
XML Peg (wip)
Document
= meta:XMLDecl? elements:Element* {
return { meta, elements }
}
XMLDecl
= tag:DeclarationTag Whitespace {
return tag;
}
DeclarationTag
= '<?xml' attributes:Attribute* Whitespace '?>' {
@okayurisotto
okayurisotto / msec_override.js
Last active November 21, 2023 14:50
ノートの投稿時刻をミリ秒単位で表示
// ==UserScript==
// @name msec_override for misskey.io
// @namespace https://misskey.okayurisotto.net/@okayurisotto
// @version 0.5
// @description ノートの投稿時刻をミリ秒単位で表示
// @author @okayurisotto@misskey.okayurisotto.net
// @match https://misskey.io/*
// @grant none
// @license MIT
// ==/UserScript==
@okayurisotto
okayurisotto / mermaid.md
Created November 19, 2023 04:03
Misskey ApPersonService
flowchart TD
    updatePerson* --> resolveAvatarAndBanner
    createPerson* --> resolveAvatarAndBanner

    createPerson* --> validateActor
    updatePerson* --> validateActor

    updatePerson* --> analyzeAttachments
 createPerson* --&gt; analyzeAttachments
@okayurisotto
okayurisotto / misskey-api-errors.ts
Last active August 19, 2023 08:24
Misskey(`60fe5d6`)のAPIError用定義一覧
// admin/roles/assign.ts
export const accessDenied = {"message":"Only administrators can edit members of the role.","code":"ACCESS_DENIED","id":"25b5bc31-dc79-4ebd-9bd2-c84978fd052c"} as const;
// admin/roles/unassign.ts
export const accessDenied_ = {"message":"Only administrators can edit members of the role.","code":"ACCESS_DENIED","id":"24636eee-e8c1-493e-94b2-e16ad401e262"} as const;
// channels/update.ts
export const accessDenied__ = {"message":"You do not have edit privilege of the channel.","code":"ACCESS_DENIED","id":"1fb7cb09-d46a-4fdf-b8df-057788cce513"} as const;
// drive/files/delete.ts
export const accessDenied___ = {"message":"Access denied.","code":"ACCESS_DENIED","id":"5eb8d909-2540-4970-90b8-dd6f86088121"} as const;
// drive/files/show.ts
export const accessDenied____ = {"message":"Access denied.","code":"ACCESS_DENIED","id":"25b73c73-68b1-41d0-bad1-381cfdf6579f"} as const;
type Item = StringItem | NumberIntem;
type StringItem = { key: "string"; value: string };
type NumberIntem = { key: "number"; value: number };
type ObjectUnionToEntryUnion<T extends Item> = T extends unknown
? [T["key"], T["value"]]
: never;
type Entry = ObjectUnionToEntryUnion<Item>;
const items: Item[] = [