Skip to content

Instantly share code, notes, and snippets.

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

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

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

  • Getting Started: インストール、セットアップ
  • Tutorial: 基本的な使い方(代表的な使い方)
  • Concepts: デザインのコンセプト、なぜ作ったか
  • Examples: 動くサンプル
  • API Reference: APIのリファレンス
@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 / Bluesky: auto refresh.user.js
Last active July 27, 2023 09:48
Bluesky: auto refresh
// ==UserScript==
// @name Bluesky: auto refresh
// @namespace https://efcl.info
// @match https://bsky.app/*
// @grant none
// @version 1.0
// @author azu
// @description Auto Refresh when notifications is shown
// ==/UserScript==
const origSetInterval = window.setInterval;
@azu
azu / README.md
Last active January 16, 2023 14:46
Migration Script: Convert TypeScript project to Node.js dual package

Convert TypeScript library project to Node.js Dual Package

It is a script to convert a TypeScript library project to a Node.js Dual CommonJS/ES module packages.

This script aim to convert following project:

  • Use TypeScript
  • Use ts-node
  • Use mocha
@azu
azu / 2022.08.23-ubuntu-18.04u.yml
Last active August 23, 2022 13:57
shepherd script: update ubuntu-18.04 to ubuntu-latest on GitHub Actions
id: 2022.08.23-ubuntu-18.04
title: "CI: update ubuntu-18.04 to ubuntu-latest"
adapter:
type: github
search_type: code
search_query: org:{{user}} path:/.github/workflows
hooks:
should_migrate:
- ls .github/workflows
- find .github/workflows -type f -name "*.y*ml" -exec grep "ubuntu-18.04" {} +;
@azu
azu / javascript-protocol-XSS.md
Last active May 25, 2023 00:12
<a href=javascript:alert(1) traget=_blank>XSS</a> behavior in modern browser.

Almost browsers prevent to XSS that is using javascript: protocol.

<a href=javascript:alert(location.origin) traget=_blank>XSS</a>

Demo: https://nuvjcp.csb.app/

Summary

@azu
azu / Pre-hijacking Attacks.md
Last active November 28, 2023 02:22
Pre-hijacking Attacksのメモ書きやSSO/パスワードリセット/アカウントマージ周りのチェックリスト

Pre-hijacking Attacksについてのメモ書きです。 元の論文と記事は次のページを読んでください。

Pre-hijacking Attacks はメールアドレスの確認をしないでアカウントを作れるサービスという前提があります。

アカウント作成からそのまま機能を利用できるようにすることで、利用体験をよくするための施策として、メールアドレスの確認のステップを後回し またはしないサービスがあります。

@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active March 13, 2024 17:32
Unofficial R2 notes
@azu
azu / README.md
Last active November 2, 2022 08:00
サブドメインをユーザーホスティングサイトに使うときのパターン(Same Origin/Cookie/Public Suffix List)

サブドメインをユーザーホスティングサイトに使うときのパターン

hoge.example.com でユーザが作成したサイトをホスティングして、任意のJavaScriptを実行できる状態にしたいケース。 サブドメインを分けることで、Fetch APIなどはSame Origin Policyを基本にするため、別のサブドメインや example.com に対するリクエストなどはできなくなる。

一方で、CookieはSame Origin Policyではない。 デフォルトでは、hoge.example.com から example.com に対するCookieが設定できる。 これを利用したDoS(Cookie Bomb)やこの挙動を組み合わせた別の脆弱性に利用できる場合がある。

@Jaid
Jaid / migratingRules.md
Last active February 21, 2024 10:48
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{