⭐ | restaurant | cuisine | what to get | location | delivery | reviews | remarks |
---|---|---|---|---|---|---|---|
Al Bacaro | italian | spaghetti al ragù | centrum | ubereats | tripadvisor | ||
The Bab | korean | dolsot bibimbab | oost, west, zuid | ubereats, ubereats | [tripadvisor](https://www.tripadvisor.com/Restaurant_Review-g188590-d17613577-Reviews-The_BAB_A |
This file contains hidden or 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 bash | |
set -eEo pipefail | |
shopt -s inherit_errexit >/dev/null 2>&1 || true | |
if [[ ! "$#" -eq 2 || "$1" != --bucket ]]; then | |
echo -e "USAGE: $(basename "$0") --bucket <bucket>" | |
exit 2 | |
fi |
This file contains hidden or 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
# Example usage: $(call find,. /foo,*.bar *.baz) | |
find = $(foreach path,$1,$(foreach pattern,$2,$(wildcard $(path)/$(pattern)) $(foreach dir,$(wildcard $(path)/*/),$(call find,$(dir:%/=%),$(pattern))))) |
This file contains hidden or 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
# Example usage: $(call retry,3,something that might fail) | |
retry = for ((i=0; i < $1; ++i)); do ( $2 ) && exit 0; sleep 3; done; false |
This file contains hidden or 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 bash | |
# Requirements: bash, coreutils, fzy, xdotool, xterm. | |
# | |
# Position and decorations can be set in i3 with something like: | |
# for_window [class="^FuzzyRun"] floating enable border none move position center | |
# | |
# Either `-fullscreen', or `-geometry' should be used. With both in place, | |
# `-fullscreen' takes precedence. |
This file contains hidden or 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
% htpasswd -nb foo bar >passwd | |
% ./chkpasswd.exp passwd foo bar | |
% echo "$?" | |
# 0 = match, 1 = no match |
This file contains hidden or 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
# This function greps everything between the last two prompts in the current tmux pane. | |
# Arguments are passed to `grep -i', so any valid `grep' options can be supplied. | |
# Requirements: coreutils, grep, sed, tmux, zsh. | |
just() { | |
local -r max=10000 psone="$(print -P "$PS1"|sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")" | |
local inside=0; | |
tmux capture-pane -pS-"$max" -E"$max"|tac|\ | |
while IFS= read -r line; do | |
case "$inside,$line" in |
This file contains hidden or 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
// This generates a consistent, per-branch, not-really-random, | |
// execution time between 20:00 and 5:59 every day. | |
branchNum = BRANCH_NAME.inject(0) { acc, c -> acc + ((c as char) as int) } | |
cronHour = [20, 21, 22, 23, 0, 1, 2, 3, 4, 5][branchNum % 10] | |
cronMinute = branchNum % 60 | |
cronParams = "${cronMinute} ${cronHour} * * *" | |
// ... |
This file contains hidden or 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
# Requires: bash (I use it in zsh), coreutils, git. | |
# Print link(s) to file(s) in repo(s), with optional line numbers. | |
# $@ := file_path[:file_line] [ file_path2[:file_line2] [ ... ] ] | |
repolink() { | |
local branch f file host origin url_path | |
for f in "$@"; do | |
file="$(realpath "$f")" | |
checkout_path="$(git -C "$(dirname "$file")" rev-parse --show-toplevel)" | |
origin="$(git -C "$checkout_path" config --get remote.origin.url)" |
launchctl load -w /Library/LaunchDaemons/local.pfctl.plist
macOS 10.11 introduced System Integrity Protection, which makes /System (and consequently /System/Library/LaunchDaemons/com.apple.pfctl.plist) immutable, even to root. This means the plist can't be modified to enable packet filter (by adding the -E
switch to pfctl). The solution is to create a custom launchd daemon, which only calls pfctl -E
(calling pfctl -E -f /etc/pf.conf
conflicts with com.apple.pfctl.plist, which may cause failure and pf not being enabled).