Skip to content

Instantly share code, notes, and snippets.

@fujitayy
fujitayy / stack trace
Created April 21, 2020 04:20
dstat OverflowError 記念
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
@fujitayy
fujitayy / Haskell開発環境.md
Last active July 10, 2019 08:48
Haskell 開発環境

コンパイラのバージョン管理

stackを使う。

インストール: curl -sSL https://get.haskellstack.org/ | sh

インストール後 stack setup とすることで最新のHaskellコンパイラ(GHC)が入る。

パッケージマネージャ

@fujitayy
fujitayy / config.fish
Last active February 3, 2019 14:36
fbin
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
@fujitayy
fujitayy / playground.rs
Created January 17, 2019 01:24 — forked from rust-play/playground.rs
Code shared from the Rust Playground
pub mod person {
use std::marker::PhantomData;
#[derive(Debug)]
pub struct Person {
name: String,
age: u8,
}
impl Person {
@fujitayy
fujitayy / playground.rs
Created January 8, 2019 08:09 — forked from rust-play/playground.rs
Code shared from the Rust Playground
//! この方法の方でCakeパターンをするとintellij-rustでの補完が効くケースが多い。
type Error = Box<std::error::Error>;
#[derive(Debug, Clone, Copy)]
struct EmployeeId(u64);
#[derive(Debug)]
struct Employee {
id: EmployeeId,
@fujitayy
fujitayy / playground.rs
Created December 26, 2018 07:05 — forked from rust-play/playground.rs
Code shared from the Rust Playground
//! 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
}
## consoleの表示を整える系
* [tabwriter](https://crates.io/crates/tabwriter) - consoleのタブ幅を表の見た目になるように整えてくれる
* [prettytable-rs](https://crates.io/crates/prettytable-rs) - console上に表を書いてくれる
@fujitayy
fujitayy / docs.md
Last active March 13, 2018 01:11
PWA/AMP/WebComponents資料
if [ -p /dev/stdin ]; then
echo "IN PIPE"
elif [ -p /dev/stdout ]; then
echo "OUT PIPE"
else
echo "NO PIPE"
fi