ファイルについて
- src ディレクトリ以下の exam1-1.ts から exam1-4.ts が TypeScript ファイルが記述したプログラムである。
- 後述の通りの環境で TypeScript を JavaScript にコンパイルし、実行することができる。
- 参考として後述の通りの環境で JavaScript にコンパイルしたファイルを out に出力している。
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: { |
# 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 |
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] | |
} |
import { | |
exec, | |
spawn, | |
SpawnOptionsWithoutStdio, | |
} from 'child_process' | |
import { createInterface } from 'readline' | |
import { promisify } from 'util' | |
process.stdin.setEncoding('utf8') |
#cloud-config | |
package_reboot_if_required: true | |
groups: | |
- docker | |
users: | |
- default | |
- name: ubuntu |
div[data-testid="sidebarColumn"] { | |
display: none; | |
} | |
div[data-testid="primaryColumn"] { | |
max-width: initial; | |
} | |
div[data-testid="primaryColumn"] > div > div { | |
max-width: initial; | |
} |
#!/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/ |
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', |
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 => |