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
/* | |
Based on Herb Sutter's monitor implementation presented on | |
https://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Herb-Sutter-Concurrency-and-Parallelism at 40:30, | |
which is, I hope, public domain. | |
*/ | |
#include <utility> | |
#include <shared_mutex> | |
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
// http://channel9.msdn.com/Events/GoingNative/2013/Inheritance-Is-The-Base-Class-of-Evil | |
#include <iostream> | |
#include <memory> | |
#include <string> | |
#include <vector> | |
// ===== library ==== | |
class Document |
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
#!/bin/bash | |
# usage: _docker_wrapper [--root] image command | |
user="--user=${UID}" | |
if [[ "$1" == "--root" ]]; then | |
user="--user=root" | |
shift | |
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
#include <iostream> | |
#include <memory> | |
#include <type_traits> | |
class Base | |
{ | |
public: | |
virtual void foo() const = 0; | |
}; |
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
#!/usr/bin/env python3 | |
import argparse | |
import os.path | |
import sys | |
def parse_args(argv): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('path') |
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
#!/bin/bash | |
if [[ ! -e "$1" ]]; then | |
echo "\"$1\" - no such file or directory" >&2 | |
exit 1 | |
fi | |
resolve_to_absolute() { | |
sudo btrfs inspect-internal inode-resolve -v $(stat -c "%i" "$1") $(stat -c "%m" "$1") | tail -n +2 | |
} |
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
#include <experimental/optional> | |
#include <experimental/type_traits> | |
#include <type_traits> | |
#include <utility> | |
#include <vector> | |
namespace stdex = std::experimental; | |
template < | |
typename Optional, |
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
#!/bin/bash | |
die() { | |
echo "$1" >&2 | |
exit 1 | |
} | |
(( $# > 1 )) \ | |
&& die "too many arguments" |
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
#!/bin/sh | |
docker images -q --filter dangling=true | xargs -r docker rmi |
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
#!/bin/bash | |
(($# == 0)) \ | |
&& set "." | |
find "$@" -type d -exec chmod 755 {} + | |
find "$@" -type f -exec chmod 644 {} + |
OlderNewer