Skip to content

Instantly share code, notes, and snippets.

View legokichi's full-sized avatar
😇
neary heaven

Legokichi Duckscallion legokichi

😇
neary heaven
View GitHub Profile
diff --git a/src-main/context.c b/src-main/context.c
index d84858c..08a0de5 100644
--- a/src-main/context.c
+++ b/src-main/context.c
@@ -594,7 +594,7 @@ anthy_save_history(const char *fn, struct anthy_context *ac)
dprintf(fd, "\n");
/**/
errno = 0;
- if (fchmod(fd, S_IREAD | S_IWRITE)) {
+ if (fchmod(fd, S_IRUSR | S_IWUSR)) {
@legokichi
legokichi / quest3-termux.md
Last active March 1, 2025 02:45 — forked from kazuho/quest3-termux.md
Meta Quest 3のlinuxセットアップ

想定読者

  • linuxに関する基本的な知識があるソフトウェアエンジニアもしくはヘビーユーザで、Quest 3のlinuxをGUI環境で使いたい人
  • apkのインストールとか説明しませんが、Quest 3に入れたやつは、アプリ一覧からカテゴリでUntrusted Sourcesみたいなのを選ぶと出てきます
  • termuxの上にlinux distroを載せるのは、遅いのでやりません(下記ベンチマーク参照)。prefixed-rootだろうがシングルユーザだろうがmusl libcだろうが我々なら大丈夫だ!
  • linuxアプリのインストールは特記事項ない限り省略します。勝手にpkg installとかして

ベンチマーク

@legokichi
legokichi / userconf.txt
Created July 19, 2024 05:16 — forked from M0LTE/userconf.txt
Raspberry Pi userconf
Create a file named user userconf (or userconf.txt) containing the following:
pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.
Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.
@legokichi
legokichi / making-the-most-of-local-llms.ipynb
Created June 10, 2024 17:39 — forked from kyo-takano/making-the-most-of-local-llms.ipynb
ローカルLLMはこーやって使うの💢
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<script>
"use strict";
async function captureDesktop() {
const localStream = await navigator.mediaDevices.getDisplayMedia({
video: {
frameRate: 15,
displaySurface: "monitor",
},
});
consolelog("make Offer");

Real World 業務 Rust

前置き これは
  • 多人数の開発で
  • Rustに不慣れな人間もかなり混ざってて
  • 富豪的プログラミングが可能な Web 開発で
  • コードオーナー不在で
@legokichi
legokichi / dynmap-chat-logger.js
Created August 14, 2023 05:07 — forked from ver-1000000/dynmap-chat-logger.js
Chromeで任意のMinecraftのDynmapを開いて、ロケーションバーに`javascript:`って打った後にコピペしてエンターするとチャットログが見れる画面が生まれるやつ
d = document; a = d.createElement('pre'); d.body.appendChild(a); a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#46486787;z-index:1'; q = (x) => d.querySelectorAll(x)[0]; m = q('.messagelist'); t = ''; o = new MutationObserver(_ => { tt = ((q('.messagerow')||{}).innerText||'').trim(); if (tt && t != tt) { a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`; t = tt; } }); o.observe(m, { childList: true })
@legokichi
legokichi / dynmap-chat-logger.js
Created August 14, 2023 05:07 — forked from ver-1000000/dynmap-chat-logger.js
Chromeで任意のMinecraftのDynmapを開いて、ロケーションバーに`javascript:`って打った後にコピペしてエンターするとチャットログが見れる画面が生まれるやつ
d = document; a = d.createElement('pre'); d.body.appendChild(a); a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#46486787;z-index:1'; q = (x) => d.querySelectorAll(x)[0]; m = q('.messagelist'); t = ''; o = new MutationObserver(_ => { tt = ((q('.messagerow')||{}).innerText||'').trim(); if (tt && t != tt) { a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`; t = tt; } }); o.observe(m, { childList: true })
@legokichi
legokichi / Commit Formatting.md
Created March 23, 2023 09:23 — forked from clemtibs/Commit Formatting.md
Angular Commit Format Reference Sheet

Commit Message Format

This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].

We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.

Virtual DOM and diffing algorithm

There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.

However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.