- はじめに的なやつ https://developers.google.com/web/fundamentals/primers/service-workers/?hl=ja
- Mozillaのドキュメント https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
- 関連機能もここから辿れる
This file contains 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
if [ -p /dev/stdin ]; then | |
echo "IN PIPE" | |
elif [ -p /dev/stdout ]; then | |
echo "OUT PIPE" | |
else | |
echo "NO PIPE" | |
fi |
This file contains 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
## consoleの表示を整える系 | |
* [tabwriter](https://crates.io/crates/tabwriter) - consoleのタブ幅を表の見た目になるように整えてくれる | |
* [prettytable-rs](https://crates.io/crates/prettytable-rs) - console上に表を書いてくれる |
This file contains 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
//! newtype patternで簡単に元の型と同等の機能を提供するには? | |
use itertools::Itertools; | |
macro_rules! impl_as { | |
($newtype:ty, $basetype:ty, $field:tt, $method:ident) => { | |
impl $newtype { | |
fn $method(&self) -> &$basetype { | |
&self.$field | |
} |
This file contains 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
//! この方法の方でCakeパターンをするとintellij-rustでの補完が効くケースが多い。 | |
type Error = Box<std::error::Error>; | |
#[derive(Debug, Clone, Copy)] | |
struct EmployeeId(u64); | |
#[derive(Debug)] | |
struct Employee { | |
id: EmployeeId, |
This file contains 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
pub mod person { | |
use std::marker::PhantomData; | |
#[derive(Debug)] | |
pub struct Person { | |
name: String, | |
age: u8, | |
} | |
impl Person { |
This file contains 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 fbino | |
echo $PATH | perl -nle 'for (split /\s|:/) { print $_ . "/" if -d }' | grep -v '/usr\|^/s\?bin' | xargs -n 1 -I'{}' find '{}' -type f | sort | uniq | xargs -n 1 file | column -s: -t | fzf | perl -pe 's/\s+.+$//; chomp if eof' | |
end | |
function fbin | |
fbino | read -lz result; commandline -- $result; commandline -f repaint | |
end |
stackを使う。
インストール: curl -sSL https://get.haskellstack.org/ | sh
インストール後 stack setup
とすることで最新のHaskellコンパイラ(GHC)が入る。
This file contains 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
Traceback (most recent call last): | |
File "/usr/bin/dstat", line 2842, in <module> | |
main() | |
File "/usr/bin/dstat", line 2687, in main | |
scheduler.run() | |
File "/usr/lib/python3.7/sched.py", line 151, in run | |
action(*argument, **kwargs) | |
File "/usr/bin/dstat", line 2799, in perform | |
line = line + o.show() + o.showend(totlist, vislist) | |
File "/usr/bin/dstat", line 519, in show |