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 | |
# w-make コマンド | |
# このファイルを PATH の通った場所に実行属性付きで w-make として保存し、 | |
# `make xxx` の代わりに `w-make xxx` を実行すると必要な依存ファイルの変更を監視して継続的に make をたたく | |
# 要: make, inotifywait, perl | |
while : | |
do | |
make "$@" |
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
type WidthDefined = {width: number}; | |
type HeightDefined = {height:number}; | |
type TitleDefined = {title:string}; | |
type AllDefined = WidthDefined & HeightDefined & TitleDefined; | |
class WidgetBuilder<T>{ | |
constructor(private params: T){} | |
width<D>(this:WidgetBuilder<D extends WidthDefined ? never : D>, width: number):WidgetBuilder<D & WidthDefined> { | |
return new WidgetBuilder(Object.assign(this.params, {width})); | |
} |
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 -eu | |
readonly NSNAME="ns${RANDOM}" | |
sudo ip netns add "$NSNAME" | |
trap "sudo ip netns delete '$NSNAME'" 0 | |
sudo ip netns exec "$NSNAME" sudo -u "$USER" "$@" |
OlderNewer