Skip to content

Instantly share code, notes, and snippets.

View HikaruEgashira's full-sized avatar

hikae HikaruEgashira

View GitHub Profile
----タスク
1900年代であると仮定して、その時代に相応しいOKRを考えなさい
----タスクを下記のJSON Schemaに一致するJSON形式で回答しなさい
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Assistant Output",
"type": "array",
"items": {
"type": "object",
"properties": {
@HikaruEgashira
HikaruEgashira / typed-format.ts
Last active July 6, 2023 09:56
C言語などによくあるprintfにTypeScriptで型をつける
type Parser<T> =
T extends `%s${infer U}`? [string, ...Parser<U>]
: T extends `%d${infer U}` ? [number, ...Parser<U>]
: T extends `${string}${infer U}` ? Parser<U>
: [];
type Format = <T extends string>(str: T, ...params: Parser<T>) => string
const format: Format = (str, ...params) => str // WIP
format("$%d/%s", 5, "day") // $5/day
// ^? const format: <"$%d/%s">(str: "$%d/%s", params_0: number, params_1: string) => string
@HikaruEgashira
HikaruEgashira / starship.toml
Last active December 31, 2021 10:01 — forked from jarrodldavis/starship.toml
vscode-devcontainer test
add_newline = false
[git_status]
disabled = true