This is an awesome list or resources on sashiko, kantha, visible mending and other related techniques.
- basic concepts of Japanese aesthetics in Ukrainian
This is an awesome list or resources on sashiko, kantha, visible mending and other related techniques.
| #!/usr/bin/env zsh | |
| ## Save initial state | |
| exec {saved_stdin}<&0 # save initial stdin | |
| exec {saved_stdout}>&1 # save initial stdout | |
| ## Redirect initial stdin and stdout to terminal |
| # Usage: compare-locales LC_TIME POSIX de_DE.UTF-8 'date' | |
| function compare-locales() { | |
| local -r category="$1" | |
| local -r locale1="$2" | |
| local -r locale2="$3" | |
| local -r command="$4" | |
| #echo "=== Comparing '$command' in $locale1 and $locale2 ===" | |
| printf "Output in %-15s %s\n" "$locale1:" "$( | |
| export "$category=$locale1" |
| # Calculate the size of a git commit in bytes. | |
| function git-commit-size() { | |
| # This script calculates the size of a git commit in bytes. | |
| # Usage: git-commit-size.sh <commit hash> | |
| # | |
| # Example: | |
| # git-commit-size.sh 1234567 | |
| # | |
| # Output: | |
| # The total size of the commit in bytes, formatted with thousands separators. |
| # List running EC2 instances filtered by `Name` tag | |
| # | |
| # params: | |
| # $1 - optional string. Filters output by instances with `Name` tag containing the string | |
| function aws-ec2() { | |
| aws ec2 describe-instances \ | |
| --filter "Name=instance-state-name,Values=running" \ | |
| --filter "Name=tag:Name,Values=*$1*" \ | |
| --query "Reservations[].Instances[].{ | |
| id: InstanceId, |
| #!/bin/sh | |
| item=$1 | |
| field=$2 | |
| bw get item "$1" \ | |
| | jq --raw-output '.fields[] | select(.name == "'"$field"'") | .value' |
| ## Global vars | |
| export LESS='--buffers=128 --HILITE-UNREAD --ignore-case --LONG-PROMPT --max-back-scroll=15 --no-init --quiet --quit-at-eof --quit-if-one-screen --RAW-CONTROL-CHARS --status-column --tabs=4 --window=-4' | |
| export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"' | |
| export FZF_DEFAULT_OPTS='--height 50% --ansi --info=inline' | |
| export EDITOR='/usr/local/bin/nvim' | |
| ## zinit | |
| source ~/.zinit/bin/zinit.zsh |
| def foo(Object... args) { | |
| def normalizedArgs = [] | |
| if (args != null) { | |
| if (args.size() == 1) { | |
| normalizedArgs << args[0] | |
| } else { | |
| normalizedArgs += args.toList() | |
| } | |
| } | |
| print('foo(varargs): ' + normalizedArgs.size() + ': ') |
| /** | |
| * Class Wrapper allows to wrap and execute variable number of nested Closures. | |
| * Immediately-wrapped closure is accessible inside the wrapper as variable `_`. | |
| */ | |
| final class Wrapper { | |
| private final List stack = [] | |
| Wrapper leftShift(Closure c) { | |
| c.resolveStrategy = Closure.DELEGATE_FIRST | |
| stack << c |
| String getHostFromUrl(String url) { | |
| url | |
| .replaceAll('^[a-z]+://', '') | |
| .replaceAll('(/.*)?$', '') | |
| .replaceAll('(:[0-9]+)?$', '') | |
| } | |
| def getHostFromUrlSpec() { | |
| expect: | |
| getHostFromUrl('https://example.com:9999/path.ext') == 'example.com' |