Skip to content

Instantly share code, notes, and snippets.

View airtoxin's full-sized avatar
🌴
On vacation

Ryoji Miyazato airtoxin

🌴
On vacation
View GitHub Profile

この記事はダムアドベントカレンダー4日目の記事です。

丸沼ダム

群馬県の国道120号線沿いにある丸沼、大尻沼の間に存在しているダムです。
バットレスダムと呼ばれる丸沼ダムが何よりも特徴的なのがそのバットレス構造です。
現存する国内のダムではもう数基しか無いバットレスダムで、写真の通り水圧を支える遮水壁をコンクリート造りの柱と梁で補強するという独特の構造を持っています。 めっちゃかっこいいです。

javascript:xp=window.prompt("Input XPath");document.getElementsByXPath=function(t,e){for(var n=[],u=document.evaluate(t,e||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),a=0,l=u.snapshotLength;a<l;a++)n.push(u.snapshotItem(a));return n};alert(document.evaluate(xp, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ).snapshotLength);console.log(xp);console.log(document.getElementsByXPath(xp))
@airtoxin
airtoxin / insyu.md
Last active December 11, 2019 21:55
飲酒プログラミングアドベントカレンダー2019

飲酒プログラミング2019-12-11

この記事は 飲酒プログラミング Advent Calendar 2019 11日目の記事です。

本日の飲酒プログラム

友人から台湾旅行土産のビールを頂いたのでそれをつまみにプログラミングです。

@airtoxin
airtoxin / setup.sh
Last active May 30, 2020 00:47
curl https:/GISTURL | bash -s NAME_OF_APP
npx create-react-app $1 --template typescript
cd $1
yarn add -DE prettier typescript
SCRIPTS=$(cat package.json | jq -c $'.scripts + {"fmt":"prettier --write \'**/*.{js,jsx,ts,tsx,json,md}\' --ignore-path .gitignore"}')
cat package.json | jq ". + {"scripts": $SCRIPTS}" > package.json.tmp
mv package.json{.tmp,}
COMPILER_OPTIONS=$(cat tsconfig.json | jq -c $'.compilerOptions + {"noImplicitAny": true}')
cat tsconfig.json | jq ". + {"compilerOptions": $COMPILER_OPTIONS}" > tsconfig.json.tmp
mv tsconfig.json{.tmp,}
git add .
@airtoxin
airtoxin / post-checkout
Last active March 29, 2019 08:35
cache-node_modules git hook
#!/usr/bin/env bash
echo "[cache-node_modules] START"
CURRENT_DIR_NAME=`basename $(pwd)`
BRANCH_FROM=`git reflog show -q | head -n1 | awk '$3 == "checkout:" && $4 == "moving" {print $6}'`
BRANCH_TO=`git reflog show -q | head -n1 | awk '$3 == "checkout:" && $4 == "moving" {print $8}'`
BRANCH_FROM_CACHE_NAME="/Library/Caches/${CURRENT_DIR_NAME}_${BRANCH_FROM}_node_modules"
BRANCH_TO_CACHE_NAME="/Library/Caches/${CURRENT_DIR_NAME}_${BRANCH_TO}_node_modules"
export type Option<A> = Some<A> | None<A>;
interface IOption<A> {
isDefined(): this is IOption<A>;
isEmpty(): this is IOption<A>;
nonEmpty(): this is IOption<A>;
map<B>(f: (val: A) => B): IOption<B>;
flatMap<B>(f: (val: A) => Option<B>): Option<B>;
forEach(f: (val: A) => void): void;
getOrElse(fallback: A): A;
@airtoxin
airtoxin / what-do-i-depend-on
Created October 1, 2018 03:01
what-do-i-depend-on
$ npx what-do-i-depend-on
npx: 18個のパッケージを6.648秒でインストールしました。
┌──────────────────────────────────────────────────┬────────────────────┐
│ PACKAGE │ COUNT │
├──────────────────────────────────────────────────┼────────────────────┤
│ mocha │ 825 │
├──────────────────────────────────────────────────┼────────────────────┤
│ ava │ 359 │
├──────────────────────────────────────────────────┼────────────────────┤
│ eslint │ 320 │
@airtoxin
airtoxin / cirquit.ts
Last active March 17, 2018 01:15
deredux
import * as React from "react";
import createReactContext from "create-react-context";
export interface CirquitContext<State> {
state: State;
dispatch: Dispatch<State>;
}
export interface Dispatch<State> {
(nextState: State): void;
@airtoxin
airtoxin / SRE_4.md
Created October 4, 2017 04:00
SRE本4章まとめ

4章 サービスレベル目標

4.1 サービスレベルに関する用語

SLI

SLI はサービスレベル指標の略で、サービスレベルの性質の計測量。

  • リクエストのレイテンシ(レスポンスを返した時刻-リクエストを受信した時刻)
  • エラー率(エラーになったリクエスト数/受信したリクエスト数)