Skip to content

Instantly share code, notes, and snippets.

Avatar

yuta.suzuki euxn23

View GitHub Profile
@euxn23
euxn23 / eslint.config.js
Last active May 1, 2023 19:52
eslint.config.js
View 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
View dot.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
View README.md

ファイルについて

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

プログラムの実行環境

実行マシンについて

@euxn23
euxn23 / pure-fisher-yates-shuffle.ts
Last active August 12, 2021 17:36
pure-fisher-yates-shuffle.ts
View pure-fisher-yates-shuffle.ts
function fisherYatesShuffle<T> (arr: T[]) {
return arr.reduce<T[]>((acc, cur, i) => {
const j = Math.floor(Math.random() * (i + 1))
return acc.map((e, idx) => {
if (idx === i) {
return acc[j]
}
if (idx === j) {
return acc[i]
}
@euxn23
euxn23 / stdio-utils.ts
Created August 6, 2021 00:47
benri.ts
View stdio-utils.ts
import {
exec,
spawn,
SpawnOptionsWithoutStdio,
} from 'child_process'
import { createInterface } from 'readline'
import { promisify } from 'util'
process.stdin.setEncoding('utf8')
@euxn23
euxn23 / cloud-config.yaml
Last active April 5, 2021 23:43
cloud-init config for ubuntu with docker and google-chrome
View cloud-config.yaml
#cloud-config
package_reboot_if_required: true
groups:
- docker
users:
- default
- name: ubuntu
@euxn23
euxn23 / style.css
Created March 7, 2021 12:55
Twitter のサイドのバカを消すカスタム css
View style.css
div[data-testid="sidebarColumn"] {
display: none;
}
div[data-testid="primaryColumn"] {
max-width: initial;
}
div[data-testid="primaryColumn"] > div > div {
max-width: initial;
}
@euxn23
euxn23 / post-checkout
Last active March 5, 2021 10:19
git checkout hook to dehydrate node_modules
View post-checkout
#!/usr/bin/env ruby
branch_name = `git symbolic-ref --short HEAD`.chomp
git_dir = `git rev-parse --show-toplevel`.chomp
if branch_name.match /master/
system "mv #{git_dir}/node_modules #{git_dir}/node_modules.feat"
system "mv #{git_dir}/node_modules.master #{git_dir}/node_modules"
puts 'node_modules moved'
elsif branch_name.match /^feature/
@euxn23
euxn23 / init.nvim
Created February 19, 2021 09:32
vim neovim&wsl2 compatible clipboard
View init.nvim
if has("nvim")
if system('uname -a | grep microsoft') != ''
let g:clipboard = {
\ 'name': 'myClipboard',
\ 'copy': {
\ '+': 'win32yank.exe -i',
\ '*': 'win32yank.exe -i',
\ },
\ 'paste': {
\ '+': 'win32yank.exe -o',
@euxn23
euxn23 / handler.ts
Created January 19, 2020 17:32
async reduce
View handler.ts
const statuses = await searchParams
.reduce(async (statusesPromise: Promise<Status[]>, searchParam): Promise<
Status[]
> => {
const statuses = await statusesPromise;
const nextStatuses = await searchTweet(
client,
searchParam,
sinceId
).then(ss =>