curl -fsSL https://get.docker.com | sh
sudo gpasswd -a $USER docker
newgrp docker
# NOTE: you may remove the lines below, if you prefer to use rootful docker, not rootless
sudo systemctl disable --now docker
sudo apt-get install -y uidmap
dockerd-rootless-setuptool.sh install
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
.terraform/ | |
*.pem | |
*.tf | |
*.tfstate | |
*.yaml | |
*.backup | |
istio-*/ | |
cert-manager-*/ | |
*.swp | |
env |
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
fzf --preview '([[ -f {} ]] && (bat --style=numbers --color=always {} || cat {})) || ([[ -d {} ]] && (tree -C {} | less)) || echo {} 2> /dev/null | head -200' |
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
public static String point(int x, int y) { | |
return String.format("%sx%s", x, y); | |
} | |
public static int contiguousRegions(int[][] matrix) { | |
var seen = new HashSet<String>(); | |
var count = 0; | |
for (int i = 0; i < matrix.length; ++i) { | |
for (int k = 0; k < matrix[0].length; ++ k) { |
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
#ifndef CMUOH_PIMPL_HPP | |
#define CMUOH_PIMPL_HPP | |
#include <memory> | |
#include <cstddef> | |
// See also: https://herbsutter.com/gotw/_100/ | |
// NOTES: | |
// - put all private nonvirtual members (data + functions) into T impl | |
// - when using an impl in a class, all constructors (default/copy/move) and |
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
dockerx() { | |
if [ "$#" -eq "0" ]; then | |
echo "Usage: dockerx IMAGE [OPTIONS]" | |
return 1 | |
else | |
img=$1 | |
shift | |
# remove invalid characters from the container name | |
name=`echo "$img" | tr /:?\ @ _` |
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
#ifndef CMUOH_MAKE_VECTOR_HPP_ | |
#define CMUOH_MAKE_VECTOR_HPP_ | |
#include "make_vector_details.hpp" | |
namespace cmuoh { | |
template <typename T = void, typename... Args, | |
typename V = detail::vec_type_helper_t<T, Args...>, | |
typename std::enable_if< |
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
template<typename T, typename U> | |
using assign_expression = decltype(std::declval<T&>() = std::declval<U&>()); | |
template<typename T, typename U> | |
constexpr bool is_assignable = is_detected<assign_expression, T, U>; |
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
function eval(num1, operator, num2) | |
if operator == '+' then | |
return num1 + num2 | |
elseif operator == '-' then | |
return num1 - num2 | |
elseif operator == '*' then | |
return num1 * num2 | |
elseif operator == '/' then | |
return num1 / num2 | |
else |
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 "overload.hpp" | |
#include <iostream> | |
#include <string> | |
#include <variant> | |
int main() { | |
using namespace cmuoh; | |
std::variant<int, float, std::string> intFloatString { "Hello" }; | |
std::visit(overload { |
NewerOlder