Skip to content

Instantly share code, notes, and snippets.

View tai2's full-sized avatar
🐢

Taiju Muto tai2

🐢
View GitHub Profile
On the Movements of the Earth
size(400, 400);
line(120, 80, 340, 300);
----
火星の奇跡
地球から見上げる
なにかの星座のまわりを回る
* 10/12
@tai2
tai2 / earth-mars.pde
Last active March 1, 2025 02:11
Explain the relation between Earth and Mars
float earth_angle = 1;
float mars_angle = 0;
float earth_velocity = -0.005;
PVector sun;
float mars_circle_extent = 150;
float planet_extent = 10;
void setup() {
size(1000, 1000);
sun = new PVector(width * 0.5, height * 0.5);
@tai2
tai2 / a.js
Created February 19, 2025 01:59
device and simulator information
import { utilities } from "appium-ios-device";
import { getSimulator } from "appium-ios-simulator";
const main = async () => {
const udid_list = await utilities.getConnectedDevices();
console.log(udid_list);
for (const udid of udid_list) {
const deviceInfo = await utilities.getDeviceInfo(udid);
console.log(deviceInfo);
$ sysctl hw | grep cache
hw.perflevel0.l1icachesize: 196608
hw.perflevel0.l1dcachesize: 131072
hw.perflevel0.l2cachesize: 16777216
hw.perflevel1.l1icachesize: 131072
hw.perflevel1.l1dcachesize: 65536
hw.perflevel1.l2cachesize: 4194304
hw.cacheconfig: 8 1 4 0 0 0 0 0 0 0
hw.cachesize: 3481141248 65536 4194304 0 0 0 0 0 0 0
@tai2
tai2 / upload.js
Created August 19, 2024 14:18
Upload file to giga便
const uuid = require("uuid");
const crypto = require("crypto");
const fs = require("fs");
const buffer = require('buffer');
const upload = async () => {
const id = crypto.randomBytes(16).toString("hex");
console.log('id', id)
const blob = new Blob(['hello there']);
import subprocess
from concurrent.futures import ThreadPoolExecutor, as_completed
def invoke_command():
subprocess.run(["sleep", "5"])
print("done")
def main():
@tai2
tai2 / a.ts
Created January 3, 2024 07:02
import {
DOMParser,
Element,
} from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
const doc = new DOMParser().parseFromString(
`
<h1>Hello World!</h1>
<p>Hello from <a href="https://deno.land/">Deno!</a></p>
`,
@tai2
tai2 / a.md
Last active October 20, 2023 05:45
-
Unified Tap
@tai2
tai2 / spacing_test.md
Created August 1, 2023 08:48
Spacing Test

800円以上で送料50円引き

@tai2
tai2 / how-to-review-purll-requests.md
Created September 8, 2022 07:09
プルリクエストレビューチェックリスト
  • 全体的な意図。なにをどうやって実現するのか(What, How)。
  • 変更の文脈、位置付け。なぜこの変更が必要なのか(Why)。
  • 複数の独立した問題が含まれているか
    • 含まれている場合、分割できないか検討する
  • 設計の誤りは影響が後を引く可能性があるので、なるべくちゃんと見ておきたい。とくに永続化されるデータ構造のミスは、リリースしてしまうと修正な面倒なので、注意する必要がある。例えば:
    • SQLアンチパターンに該当するようなテーブル設計になっている(実データが発生するとめんどう)
    • 本来別のAPIを新設すべきところを、既存APIへの追加パラメータで無理矢理処理している(修正される挙動への依存が増えるとめんどう)
    • 手続の種類が増えても修正不要なように書ける(一度書けば済む)のに、手続の数だけコード追加が必要な設計になっている(無駄な手数が増える)
  • 追加・変更される挙動について、テストケースが追加・変更されているか、テストケースの見出しレベルで簡単に見る
  • 特殊な理由のある変更など、コードだけから理解できなさそうな変更は、コメントに経緯が書かれているかを見る