Skip to content

Instantly share code, notes, and snippets.

View na2hiro's full-sized avatar
💽
Remix!

na2hiro na2hiro

💽
Remix!
View GitHub Profile
@na2hiro
na2hiro / swap-codex-accounts.sh
Last active September 10, 2026 04:46
swap-codex-accounts.sh
#!/bin/bash
cd ~/.codex/ || exit 1
if [ -f auth.json.b ]; then
mv auth.json auth.json.a
mv auth.json.b auth.json
else
mv auth.json auth.json.b
mv auth.json.a auth.json
@na2hiro
na2hiro / gist:13e7cecf1c1cd36f58602be3b25581f1
Created May 10, 2025 17:00
量子将棋の初手合法手列挙(perft(1)の確認用)
1: 1三量子成(1七)
2: 1三量子(1七)
3: 5三量子成(1七)
4: 5三量子(1七)
5: 1四量子(1七)
6: 4四量子(1七)
7: 1五量子(1七)
8: 2五量子(1七)
9: 3五量子(1七)
10: 1六量子(1七)
@na2hiro
na2hiro / README.md
Last active November 7, 2023 12:52
Sharing objects between custom server and Remix code (aka. Use socket.io in Remix) https://github.com/remix-run/remix/discussions/7454#discussioncomment-7498534

Candidates for name of the lib

  • namespaced-inputs
  • input-namespace
  • namespaced-fieldset
  • nested-input (nested-input*s* is taken)
  • uncontrolled-inputs

[lib name here] (README draft)

@na2hiro
na2hiro / Remix-request-cheatsheet.md
Last active June 6, 2026 07:09
Remix request cheatsheet
const fs = require('fs');
const {JKFPlayer} = require('json-kifu-format');
const {Iconv} = require("iconv");
let dir = "muso";
const result = [];
const sjisIconv = new Iconv("cp932", "utf-8");
fs.readdir(`./${dir}`, async (err, files) => {
@na2hiro
na2hiro / _ts4029_error_case
Last active August 29, 2015 14:25
TS4029 error case
$ sh ./run.sh
ts4029.ts(5,2): error TS4029: Public property 'mod' of exported class has or is using name '' from external module "mod" but cannot be named.
ts4029-another-variable.ts(6,2): error TS4029: Public property 'mod2' of exported class has or is using name '' from external module "mod" but cannot be named.
import mod = require('./mod');
console.log(mod.version);
@na2hiro
na2hiro / gist:f62246100f7bfece8815
Created January 31, 2015 18:03
Javaにおいてダウンキャストの代替となるパターンマッチ構文の一案
Number number = getNumber();
// before
if(number instanceof Integer){
((Integer)number).someIntegerMethod();
}else if(number instanceof Float){
((Float)number).someFloatMethod();
}
// after
match(number){
case Integer:
@na2hiro
na2hiro / gist:34fa77893a0775f18fd1
Last active August 29, 2015 14:09
スーパー正男JSブックマークレットお試し版
javascript:!function(){var s = document.createElement("script");s.src = "http://81.la/tmp/masao-bookmarklet-public.js";document.body.appendChild(s);}();void 0;
  • Canvasまさおについて
    • スーパー正男のJavaScript移植版,Javaを一切使いません.
    • 動かないところもいくつか
    • 手を加えないとIE以外では動きません.
    • RYOさんという方が開発されています. http://ux.getuploader.com/canvasmasao/
  • github上でのリポジトリ公開をお願いしました