Skip to content

Instantly share code, notes, and snippets.

View KisaragiEffective's full-sized avatar
🔧
painful state

Kisaragi KisaragiEffective

🔧
painful state
  • Some(_)
  • Hokkaido, Japan
View GitHub Profile
@KisaragiEffective
KisaragiEffective / discord-update.sh
Created June 11, 2024 17:37
Debian 12でDiscordが古いと文句を言ってくる問題を解決するシェルスクリプト
#!/bin/bash
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2024 Kisaragi Marine
d="$(mktemp)"
if [ -t 1 ]; then
tty=1
else
tty=0
fi
@KisaragiEffective
KisaragiEffective / booth_bulk_gen.js
Created November 26, 2023 14:17
BOOTHの商品決済完了画面でTwitterのリンクから全ての内容を結合したテキストを生成するスクリプト
/*
SPDX-License-Identifier: CC0-1.0
SPDX-FileCopyrightText: 2023 Kisaragi Marine <kisaragi.effective@gmail.com>
*/
[...document.querySelectorAll('a[href^="https://twitter.com"]')].map(a => new URL(a.href)).map(url => url.searchParams).map(p => p.get("text") + " " + p.get("url") + " #" + p.get("hashtags")).join("\n")
#/bin/sh
git log --date=short --pretty="%an %H %ad %s" | grep -E '^syuilo' | grep -Ev '(#\d+|Merge branch .* into develop)$' | grep -Ev '[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?$' | grep -Ev '(fix|perf|enhance|chore|refactor)(\([^\)]+\))?: .*$' | less
@KisaragiEffective
KisaragiEffective / list-aspect-ratio.sh
Created September 9, 2023 13:10
Grub all emoji from a misskey server and outputs its width and height.
#!/bin/bash
# SPDX-FileCopyrightText: 2023 Kisaragi Marine <kisaragi.marine@gmail.com>
# SPDX-License-Identifier: MIT OR Apache-2.0
set +x
die() {
echo "$@" >&2
exit 1
#[cfg(test)]
mod tests {
use std::cell::{Cell, RefCell};
use origlang_compiler::entry::{PreOrPost, Scanner, TheCompiler};
use origlang_diagnostics::{CauseTree, Diagnostic, DiagnosticSeverity, DiagnosticSink};
use origlang_ir::IR1;
use origlang_ir_optimizer::preset::SimpleOptimization;
use origlang_source_span::CanonicalSourceSpan;
struct MyScanner;
console.log([...$0.querySelector("tbody").querySelectorAll("tr")].slice(2).map(x => x.querySelector("td:nth-child(1)").innerText).join())

GitHub連携ログインでログインするとアプリ側のOAuthが無視されるのでパスワードでログインすること。

(※正確な情報は公式ドキュメントを参照されたい)

Borrowed Owned Ownedは可変長? 説明
&str String Yes 文字列型。UTF-8であることが保証されている。
&[T] Vec<T> Yes 並んだ型。大体配列。
&OsStr OsString Yes 文字列型。OS依存のエンコーディング。
&Path PathBuf Yes ファイルのパス。

|Non-borrowed|Borrowed|説明|

/home/kisaragi/.cargo/bin/cargo build --color=always --message-format=json-diagnostic-rendered-ansi --package booth-upload --bin booth-upload
Compiling booth-upload v0.1.0 (/media/kisaragi/1ff2735d-2180-4373-b9d0-5659da182833/IdeaProjects/booth-upload)
error: internal compiler error: encountered incremental compilation error with mir_built(c0450cf43ee61992-5de80d92034453ba)
|
= help: This is a known issue with the compiler. Run `cargo clean -p booth_upload` or `cargo clean` to allow your project to compile
= note: Please follow the instructions below to create a bug report with the provided information
= note: See <https://github.com/rust-lang/rust/issues/84970> for more information
thread '<unnamed>' panicked at 'Found unstable fingerprints for mir_built(c0450cf43ee61992-5de80d92034453ba): Steal { value: RwLock(RefCell { value: Some(Body { basic_blocks: BasicBlocks { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), StorageLive(_4), _4 = &_1], terminator: Some(Terminator { source_info

ローカルパッチ

まず手元でパッチを当てるためのブランチを作成。ここではlocal/patchとする。このブランチはpushせず、手元で変更内容を反映したcommitを格納するためだけに使う。

* ここにローカルのパッチ (local/patch)
|
* (origin/main/HEAD)