この文章は、一緒のチームで仕事をする人に、自分(@NotFounds)がどんな人間か理解してもらうためのドキュメントです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jpath() { | |
local JSONFILE=$1 | |
local _paths=$(jq -cr 'paths | map(if type=="number" then "[" + tostring + "]" else "." + tostring end) | join("")' $JSONFILE) | |
local _path=$(echo "$_paths" | fzf --preview "echo {} | xargs -I path jq 'path' $JSONFILE") | |
echo "$_path" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useMemo } from "react"; | |
const joinWbr2StringArray = (ary: string[]) => { | |
const res: React.ReactNode[] = ary.filter((e) => !!e).flatMap((e, i) => [e, <wbr key={i} />]); | |
if (res.length > 0) res.pop(); | |
return res; | |
}; | |
type TextSegmenterCoreProps = { | |
children: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
version="0.1.0" | |
usage() { | |
cat <<EOF | |
$(basename ${0}) - Synchronize main/master branch with the remote. | |
Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { listenAndServe } from "https://deno.land/[email protected]/http/server.ts"; | |
const addr = ":8080"; | |
const patternsToHandlers = new Map([ | |
[{ pathname: "/" }, rootHandler], | |
[{ pathname: "/ping" }, pingHandler], | |
[{ pathname: "/user/:id" }, userHandler], | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleHttpErrors = (response: Response) => { | |
if (response.ok || response.redirected) { | |
return response; | |
} | |
// ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status | |
switch (response.status) { | |
// Client error responses | |
case 400: throw Error('Bad Request'); | |
case 401: throw Error('Unauthorized'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fuzzySearch(source: string, query: string, isIgnoreCase?: boolean): boolean { | |
if (source.length === 0 || query.length === 0) { | |
return false; | |
} | |
const _source = isIgnoreCase ? source.toLowerCase() : source; | |
const _query = isIgnoreCase ? query.toLowerCase() : query; | |
const queryIterator = function*() { | |
yield* [..._query]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cuda:10.0-cudnn7-runtime | |
RUN apt-get update && apt-get install -y \ | |
gcc \ | |
make \ | |
openssl \ | |
libssl-dev \ | |
libbz2-dev \ | |
zlib1g-dev \ | |
libreadline-dev \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
set nocompatible | |
" move by cursor | |
set whichwrap=b,s,h,l,<,>,[,],~ | |
" delete by backspace | |
set backspace=indent,eol,start | |
" file setting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# コマンドライン引数を解析するライブラリを読み込む | |
import argparse | |
# pythonの数値計算用ライブラリを読み込む | |
import numpy as np | |
# chainerを読み込む | |
import chainer | |
import chainer.links as L | |
import chainer.functions as F |
NewerOlder