Skip to content

Instantly share code, notes, and snippets.

View euxn23's full-sized avatar

yuta.suzuki euxn23

View GitHub Profile
@euxn23
euxn23 / mirrorlist
Created January 4, 2025 19:56
/etc/pacman.d/mirrorlist
Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch
Server = http://repo.jing.rocks/archlinux/$repo/os/$arch
Server = https://mirror.aria-on-the-planet.es/archlinux/$repo/os/$arch
Server = https://repo.jing.rocks/archlinux/$repo/os/$arch
Server = https://jp.mirrors.cicku.me/archlinux/$repo/os/$arch
Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
@euxn23
euxn23 / gist:ff4701ea102e15e8dfd58842ae163034
Created September 3, 2024 02:12
slack github integration
/github subscribe <repo> issues pulls reviews comments
/github unsubscribe <repo> commits releases deployments
export function parseEnv(env: '1' | '0' | 'true' | 'false' | string | undefined): string | boolean {
if (!env) {
return false;
}
try {
return Boolean(JSON.parse(env));
} catch {
return env;
}
}
@euxn23
euxn23 / .zshrc.env
Last active May 3, 2024 00:03
.zshrc.env
#!/urs/bin/env zsh
export EDITOR=nvim
export XDG_RUNTIME_DIR=/run/user/$(id -u)
# WSL
export BROWSER='pwsh.exe /c start'
alias chrome='/mnt/c/Program\ Files/Google/Chrome/Application/chrome.exe'
alias wezterm=wezterm.exe
alias wezterm-mux-server=wezterm-mux-server.exe
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,