Skip to content

Instantly share code, notes, and snippets.

@azu
azu / TypeScriptの設定の良し悪し.md
Last active April 1, 2024 10:23
TypeScriptの設定の良し悪し

tsconfig.json の設定についてのメモ書きです。

Node.jsのバージョンごとの設定

target は 変換後のコードのECMAScriptバージョンを指定する たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。

@azu
azu / docker failed to register layer: rename.md
Last active March 19, 2024 20:58
Notes on `failed to register layer: rename` error with docker pull.

📝 Docker's "failed to register layer" error on macOS/OrbStack.

Error Message

failed to register layer: rename /var/lib/docker/image/overlay2/layerdb/tmp/write-set-xxx /var/lib/docker/image/overlay2/layerdb/sha256 /<sha>: file exists

Reason

@azu
azu / README.md
Last active March 15, 2024 09:59
スタートアップ/企業の調べ方
const draw = (output) => console.log(output);
const getWeather = async (city) => {
await new Promise((resolve) => setTimeout(resolve, 1000));
return "sunny";
};
const render = async function* ({ city }) {
yield `<Spinner />`;
const weather = await getWeather(city);
return `<Weather info=${weather} />`;
@azu
azu / kagi-to-google.js
Created February 29, 2024 04:10
Surfingkeys shortcut: kagi.com to google
api.mapkey("g", "Kagi to Google", function () {
const isKagi = location.href.startsWith("https://kagi.com/search?");
if (isKagi) {
location.href = `https://www.google.com/search?q=${(new URL(location.href)).searchParams.get("q")}`;
}
});
// ==UserScript==
// @name Disable keyboard shortcuts
// @description Stop websites from highjacking keyboard shortcuts
//
// @run-at document-start
// @include https://github.com/*
// @grant none
// ==/UserScript==
keycodes = [84] // Keycode for 'T', add more keycodes to disable other key captures
@azu
azu / README.md
Created June 6, 2021 07:13
Decrypt and restore iOS backup(`Manifest.db` is encrypted) for restoring my iOS photos.

Setup

Use https://github.com/jfarley248/iTunes_Backup_Reader

git clone https://github.com/jfarley248/iTunes_Backup_Reader
cd iTunes_Backup_Reader
# apply https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
gh pr checkout https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
@azu
azu / README.md
Last active January 24, 2024 10:27
GitHub Package Registry and Npm Registry for same scoped does not work @ 2020-01-10

📝 I submit the same text to GitHub Support.


I want to use same scope for npm package and GitHub Package Registry.

For example, @org scope exist in npm and GitHub.

  • @org/foo-public package is public on npm registry
  • @org/bar-private package is private on GitHub Package Registry
@azu
azu / Node.js Core APIとブラウザ向けShimのギャップについて.md
Last active December 29, 2023 21:27
Node.jsコアモジュールとブラウザ向けShimの挙動の違い(ギャップ)について -> https://jser.info/2018/12/25/node-browser-libs-gap/

追記(2018-12-25): 次のレポートに同様 + 追加した内容を公開しています。


Node.jsコアモジュールとブラウザ向けShimのギャップについて

この文章は、現在進行形で機能追加や仕様変更が行われているNode.jsコアモジュールとブラウザ向けShimにおける挙動の違い(ギャップ)が広がってきている問題について調べたものです。

@azu
azu / README.md
Last active December 27, 2023 00:30
公式ドキュメントのユースケース

Ref なぜ僕は公式ドキュメントを読むのが苦手なのか #初心者 - Qiita

次のようなセクションがあった場合、何を読むかというのはその目的によって異なるという印象。

  • Getting Started: インストール、セットアップ
  • Tutorial: 基本的な使い方(代表的な使い方)
  • Concepts: デザインのコンセプト、なぜ作ったか
  • Examples: 動くサンプル
  • API Reference: APIのリファレンス