Skip to content

Instantly share code, notes, and snippets.

@killercup
killercup / min-max.rs
Created September 30, 2015 12:02 — forked from anonymous/playground.rs
Rust min! and max! macros
macro_rules! max {
($x:expr) => ( $x );
($x:expr, $($xs:expr),+) => {
{
use std::cmp::max;
max($x, max!( $($xs),+ ))
}
};
}
@hnakamur
hnakamur / gist:9427958
Last active August 2, 2018 05:03
bashのヒアドキュメントでエスケープしたくない場合はEOFを'EOF'にします。
$ cat ./heredoc_escape.sh
#!/bin/bash
cat <<EOF
FOO=$6$
EOF
$ ./heredoc_escape.sh
FOO=$
$ vim ./heredoc_escape.sh
$ cat ./heredoc_escape.sh