Skip to content

Instantly share code, notes, and snippets.

View andrey-malets's full-sized avatar

Andrey Malets andrey-malets

  • Yandex, Ural State University
  • Yekaterinburg
View GitHub Profile
template<typename> struct T {
};
template<> struct T<int> {
static const int value = 1;
};
template<> struct T<float> {
static const int value = 2;
};
#!/usr/bin/env bash
set -e -o pipefail
dev=${1:?usage: $0 <device name>}
dir="/sys/block/$dev"
if ! [[ -d "$dir" ]]; then
echo "$dev probably is not a block device (no $dir)" >&2
exit 1
#!/usr/bin/env bash
put() {
for x in "$@"; do
echo -en "$x\0"
done
}
f() {
res=(' a b' 'c d')