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 <utility> | |
#include <memory> | |
#include <iterator> | |
#include <type_traits> | |
#include <concepts> | |
namespace phd { | |
template<typename T> | |
concept copy_assignable = std::is_copy_assignable_v<T>; |
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 <cassert> | |
#include <cmath> | |
#include <concepts> | |
namespace phd { | |
template<typename T> | |
concept numeric = std::integral<T> || std::floating_point<T>; | |
template<numeric Arg, std::integral Base> |
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 <map> | |
#include <unordered_map> | |
template< | |
template<typename, typename> typename Map, | |
typename K, | |
typename V | |
> | |
class AnyMap { | |
public: |
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() { | |
echo "Usage: $0 -i [INPUT] -o [OUTPUT] -a [HASH_ALGORITHM]" | |
1>&2; | |
exit 1; | |
} | |
input="" | |
output="" |
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/python3 | |
import sys | |
import getopt | |
import codecs | |
import secrets | |
import hashlib | |
from typing import List | |
def usage(): |
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() { | |
echo "Usage: $0 [FILENAME]" | |
1>&2; | |
exit 1; | |
} | |
if [ "$#" -ne 1 ]; then | |
echo "Only a filename is needed." |
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
CheckOptions: | |
- key: readability-identifier-naming.ClassCase | |
value: CamelCase | |
- key: readability-identifier-naming.ClassMemberCase | |
value: lower_case | |
- key: readability-identifier-naming.ConstexprVariableCase | |
value: CamelCase | |
- key: readability-identifier-naming.ConstexprVariablePrefix | |
value: k | |
- key: readability-identifier-naming.EnumCase |
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 | |
TMUX_UNATTACHED=$(tmux ls | grep -E -v '\(attached\)$') | |
while read session; do | |
tmux kill-session -t "${line%%:*}" | |
done <<< $TMUX_UNATTACHED |
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
namespace { | |
using LL = signed long long int; | |
template <LL N, LL X> | |
struct PowerOf { | |
static constexpr LL value_ = N * PowerOf<N, X - 1>::value_; | |
}; | |
template <LL N> |
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 <concepts> | |
using ULL = unsigned long long int; | |
template <std::integral auto I> | |
struct Factorial { | |
static constexpr ULL value = I * Factorial<I - 1>::value; | |
}; | |
template <> |
OlderNewer