Skip to content

Instantly share code, notes, and snippets.

@outro56
outro56 / contiguousRegions.java
Created May 14, 2021 16:50
Contiguous Regions In Matrix
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) {
@outro56
outro56 / fzf-preview-selection.bash
Created September 18, 2021 17:27
Fzf: preview selection
fzf --preview '([[ -f {} ]] && (bat --style=numbers --color=always {} || cat {})) || ([[ -d {} ]] && (tree -C {} | less)) || echo {} 2> /dev/null | head -200'
@outro56
outro56 / install-docker.md
Last active September 19, 2021 04:35
Alternative to docker-desktop
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
@outro56
outro56 / .gitignore
Created September 21, 2021 00:09 — forked from pdxjohnny/.gitignore
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env