Skip to content

Instantly share code, notes, and snippets.

View ken7253's full-sized avatar
🐧

ken7253 ken7253

🐧
View GitHub Profile
@ken7253
ken7253 / tooltip.tsx
Last active February 5, 2024 14:40
Example React tooltip
import type { FC } from 'react';
import { useEffect, useId, useState } from 'react';
type Props = {
children: ReactNode;
content: ReactNode;
};
export const Tooltip: FC<Props> = ({ children, content }) => {
const [open, setOpen] = useState(false);
@ken7253
ken7253 / index.ts
Last active January 3, 2023 16:02
RGB class
class RGB {
red: number;
green: number;
bule: number;
static MAX_COLOR_INT = 255;
constructor(color: [number, number, number]) {
@ken7253
ken7253 / selectSlide.ts
Last active May 2, 2022 03:33
Selecting slides with interactive UI
import inquirer from 'inquirer';
import fs from 'node:fs';
import path from 'node:path';
import { spawn } from 'node:child_process';
/** 設定情報 */
const config = {
/** スライドを格納しているディレクトリ */
slideRoot: 'slides',
@ken7253
ken7253 / .markuplintrc.json
Created February 25, 2022 15:16
markuplint preset
{
"excludeFiles": ["**/node_modules/**/*"],
"rules": {
"attr-duplication": true,
"character-reference": true,
"class-naming": "/[a-z]+(__[a-z]+)?/",
"deprecated-attr": true,
"deprecated-element": true,
"disallowed-element": true,
"doctype": true,