Skip to content

Instantly share code, notes, and snippets.

View euxn23's full-sized avatar

yuta.suzuki euxn23

View GitHub Profile
repeat 100 pnpm test -- --ci --silent <test file> &>/dev/null && echo -n "." || echo -n x
@euxn23
euxn23 / eslint.config.js
Last active February 16, 2024 00:28
pnpm i -DE eslint typescript-eslint eslint-plugin-import eslint-plugin-unused-imports eslint-plugin-react eslint-plugin-react-hooks esint-plugin-jsx-a11y
// @ts-check
import typescript from 'typescript-eslint'
import reactPlugin from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
import importPlugin from 'eslint-plugin-import'
import unusedImportsPlugin from 'eslint-plugin-unused-imports'
import js from '@eslint/js'
import globals from 'globals'
@euxn23
euxn23 / use-behavior-subject.ts
Last active February 15, 2024 23:00
use-behavior-subject.ts
import { BehaviorSubject } from 'rxjs'
import { useSyncExternalStore } from 'react'
export function useSyncBehaviorSubject<T>(subject: BehaviorSubject<T>): T {
return useSyncExternalStore(
(onStoreChange) => {
const subscription = subject.subscribe(onStoreChange)
return () => subscription.unsubscribe()
},
() => subject.value
@euxn23
euxn23 / Center.tsx
Created December 26, 2023 17:57
Radix UI utilities
import { ReactNode } from "react";
import { Flex } from "@radix-ui/themes";
export function Center({ children }: { children: ReactNode }) {
return (
<Flex justify="center" direction="column" align="center" height="100%" width="100%" gap="4">
{children}
</Flex>
);
}
@euxn23
euxn23 / .prettierrc
Last active December 26, 2023 16:27
.prettierrc
{
"singleQuote": true,
"semi": false,
"printWidth": 160
}
@euxn23
euxn23 / eslint.config.js
Last active October 29, 2023 02:42
eslint for vue
import typescriptParser from "@typescript-eslint/parser"
import typescriptPlugin from "@typescript-eslint/eslint-plugin"
import vueParser from 'vue-eslint-parser'
import vuePlugin from 'eslint-plugin-vue'
export default [
{
files: ["src/**/*.{ts,vue}"],
languageOptions: {
parser: vueParser,
@euxn23
euxn23 / wezterm.lua
Created September 16, 2023 07:52
wezterm.lua
local wezterm = require 'wezterm';
local act = wezterm.action
local THEME_ACCENT = '#6d9df1'
local THEME_GRAY_3 = '#262626'
local THEME_GRAY_2 = '#3a3a3a'
local THEME_GRAY_1 = '#626262'
local SOLID_RIGHT_ARROW = utf8.char(0xe0b0)
local SOLID_LEFT_ARROW = utf8.char(0xe0b2)
@euxn23
euxn23 / eslint.config.js
Last active May 1, 2023 19:52
eslint.config.js
import typescriptParser from "@typescript-eslint/parser"
import typescriptPlugin from "@typescript-eslint/eslint-plugin"
import reactPlugin from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
export default [
{
files: ["src/**/*.ts{,x}"],
languageOptions: {
@euxn23
euxn23 / dot.nodoka
Last active October 17, 2022 09:54
nodoka
# The first line will be ignored
include "104.nodoka"
keymap Global
key *Semicolon= S-*Semicolon
key S-*Semicolon= ~S-*Semicolon
def key HENK = 0x79
def key MHEN = 0x7b
@euxn23
euxn23 / README.md
Last active February 9, 2022 02:02
プログラミング試験TypeScriptコンパイル環境README

ファイルについて

  • src ディレクトリ以下の exam1-1.ts から exam1-4.ts が TypeScript ファイルが記述したプログラムである。
  • 後述の通りの環境で TypeScript を JavaScript にコンパイルし、実行することができる。
  • 参考として後述の通りの環境で JavaScript にコンパイルしたファイルを out に出力している。

プログラムの実行環境

実行マシンについて