fd --glob "**.md" | xargs -I {} sed -i "1i ---\nlayout: ../../layouts/index.astro\n---" {}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { type MutableRefObject, useEffect, useRef } from "react"; | |
| type Props<T> = { | |
| elementRef: MutableRefObject<T | null>; | |
| callback: (entry: IntersectionObserverEntry) => void; | |
| options?: IntersectionObserverInit; | |
| }; | |
| export const useIntersectionObserver = <T extends HTMLElement>({ | |
| elementRef, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu -o pipefail | |
| function _sed() { | |
| if sed --version >/dev/null 2>&1; then | |
| # GNU版sed (Linux等) | |
| sed -i "$@" | |
| else | |
| # BSD版sed (macOS等) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::{fs, path::Path}; | |
| pub fn copy_dir(source: impl AsRef<Path>, destination: impl AsRef<Path>) -> anyhow::Result<()> { | |
| let destination = destination.as_ref().to_path_buf(); | |
| fs::create_dir_all(&destination)?; | |
| for entry in fs::read_dir(source)? { | |
| let entry = entry?; | |
| let source = entry.path(); | |
| let destination = destination.join(entry.file_name()); | |
| if source.is_dir() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from "react" | |
| type PromiseFunction<Succeeded> = (...parameters: never[]) => Promise<Succeeded> | |
| type UseAsync<Succeeded, Failed, F extends PromiseFunction<Succeeded>> = { | |
| data: Succeeded | null | |
| error: Failed | null | |
| execute: (...parameters: Parameters<F>) => void | |
| pending: boolean | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu -o pipefail | |
| # FIXME: プロジェクトの構成に応じて変更する | |
| ROOT_DIR=$(cd "$(dirname "$0")"; pwd) | |
| readonly ROOT_DIR | |
| function usage() { | |
| cat <<EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** For advanced users. */ | |
| { | |
| "defaultFontFamily": { | |
| "standard": null, //String - Defaults to "Times New Roman". | |
| "serif": null, // String - Defaults to "Times New Roman". | |
| "sansSerif": null, // String - Defaults to "Arial". | |
| "monospace": null // String - Defaults to "Courier New". | |
| }, | |
| "autoHideMenuBar": false, //Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is false. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as fs from 'fs'; | |
| import { z } from 'zod'; | |
| const SCHEMA = z.object({ | |
| log: z.object({ | |
| entries: z.array( | |
| z.object({ | |
| request: z.object({ | |
| url: z.string(), | |
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/make -f | |
| .DEFAULT_GOAL := help | |
| .PHONY: help | |
| help: # Show all commands. | |
| @echo "📗 Displays help information for make commands." | |
| @echo "Commands:" | |
| # コマンド一覧 -> ":" で改行 -> ":" を含む行 (前半) の \s を ", " に置換、"#" を含む行 (後半) からコメントを抽出 -> ":" で分けた個所を再連結 -> column で整形 | |
| @grep -E '^[a-zA-Z]\S+(\s\S+)*:.*' ./Makefile \ |
NewerOlder