Skip to content

Instantly share code, notes, and snippets.

View ygkn's full-sized avatar
A believing heart is your magic.

YAGITA Yugo ygkn

A believing heart is your magic.
View GitHub Profile
import React from 'react';
import { getImageProps } from 'next/image';
import Accessibility from '../../assets/accessibility.svg';
import AvifImage from '../../assets/avif-test-image.avif';
const Component = (props) => {
const {
props: { srcSet: dark },
} = getImageProps({ src: Accessibility, alt: 'Theme Example', ...props });
const rules =
require("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules").default;
const displayRule = (ruleKey) => {
const rule = rules[ruleKey.replace("@typescript-eslint/", "")];
if (!rule) {
return ruleKey;
}
return `${rule.meta.deprecated ? " 💀" : ""} ${ruleKey} - ${
rule.meta.docs.description
@ygkn
ygkn / trtr.js
Created October 15, 2023 04:47
[..."タチツテト"].flatMap(c1 => [..."ラリルレロ"].map(c2 => `${c1}${c2}`.repeat(2))).join("\n")
@ygkn
ygkn / a.svg
Created October 12, 2023 13:03
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import { type ReactRenderer, composeStories } from "@storybook/react";
import type { Store_CSFExports, PreparedStoryFn } from "@storybook/types";
import { render } from "@testing-library/react";
import { glob } from "glob";
import preview from "../.storybook/preview";
import { setProjectAnnotations } from "@storybook/react";
import { join } from "path";
openapi: 3.1.0
info:
title: TODO 管理ツール API
version: 1.0.0
servers:
- url: https://dev.example.com/api/v1
description: エンドポイント(開発)
- url: https://example.com/api/v1
description: エンドポイント(本番)
tags:
import SwaggerParser from "@apidevtools/swagger-parser";
import * as OpenAPISampler from "openapi-sampler";
import type { OpenAPI, OpenAPIV3_1 } from "openapi-types";
SwaggerParser.dereference(
"oepnapi.json"
).then((api) => {
if (!api.paths) throw new Error("No paths found in API definition");
Object.entries<NonNullable<OpenAPI.Document["paths"]>[number]>(
import type { LowerHttpMethod, AspidaResponse } from "aspida";
import {
rest,
ResponseResolver,
RestContext,
RestRequest,
DefaultBodyType,
} from "msw";
/**
for (const el of document.querySelectorAll(
"a[href^='https://bizboard.nikkeibp.co.jp/houjin/cgi-bin/nsearch/md_pdf.pl']:not([class])"
)) {
// wait 1s
await new Promise((res) => setTimeout(res, 1000));
el.download = "";
el.click();
}
for c in karen hikari mahiru nana jyunna claudine maya kaoruko futaba; do
wget "https://revuestarlight.com/wp-content/themes/revuestarlight_v0/assets/images/common/animation/character/main/revue/pc/char_${c}_revue.png"
done