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 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
String[] fontList = PFont.list();
PFont font;
String showText = "令和";
String findFont(String fontPattern) {
for (int i = 0; i < fontList.length; i++) {
String[] match = match(fontList[i], fontPattern);
if (match != null) {
return match[0];
@ygkn
ygkn / hex-base64.ts
Created August 21, 2022 00:52
Hex and Base64 interop in TypeScript
const hexToBase64 = (hex: string) =>
btoa(
String.fromCharCode(
...(hex.match(/[0-9a-f]{2}/gi) ?? []).map((c) => parseInt(c, 16))
)
);
const base64ToHex = (base64: string) =>
[...atob(base64)]
.map((c) => c.charCodeAt(0).toString(16).padStart(2, "0"))
index time(ms) size distance d/s log(d/s+1)
1 785 317.6 521.12 1.6 1.4
2 681 238.2 224.02 0.9 0.96
3 786 158.8 419.91 2.6 1.87
4 738 238.2 27.64 0.1 0.16
5 939 158.8 675.64 4.3 2.39
6 1271 238.2 711.44 3 2
7 926 79.4 290.64 3.7 2.22
8 927 79.4 366.9 4.6 2.49
9 861 238.2 624.8 2.6 1.86
[
{
"time":785,
"size":317.6,
"distance":521.12
},
{
"time":681,
"size":238.2,
"distance":224.02
@ygkn
ygkn / README.md
Last active July 21, 2022 08:00
少女☆歌劇 レヴュースタァライト in TypeScript

少女☆歌劇 レヴュースタァライト in TypeScript

import type { StorybookViteConfig } from '@storybook/builder-vite';
import { mergeConfig } from 'vite';
import viteConfig from '../vite.config';
const config: StorybookViteConfig = {
core: { builder: '@storybook/builder-vite' },
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{
console.log("array\n")
const array: string[] = [];
array[100] = "100";
array[110] = "110";
array[105] = "105";
console.log(
array.map((v) => {