Usage | Notation |
---|---|
definition | = |
concatenation | , |
termination | ; |
alternation | | |
optional | [ ... ] |
repetition | { ... } |
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
ʕ◔ϖ◔ʔ | |
U+0295, U+25D4, U+03D6, U+25D4, U+0294 |
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
# README: This allows you to store in your history file only commands | |
# with a successful status (or forced exited by you with signal 2). | |
# Put this content in your .zhsrc | |
# CREDITS: inspired by https://scarff.id.au/blog/2019/zsh-history-conditional-on-command-success/ | |
# This function will be hooked to zshaddhistory. | |
# zshaddhistory is called before a history line is saved. See zshmisc(1). | |
function my_zshaddhistory() { | |
# Prevent the command from being written to history before it's | |
# executed; save it to LASTHIST instead. Write it to history |
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
require "formula" | |
require_relative "lib/private_strategy" | |
class Hoge < Formula | |
homepage "https://github.com/yourcompany/hoge" | |
url "https://github.com/yourcompany/hoge/releases/download/v0.1.0/hoge_v0.1.0_darwin_amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy | |
sha256 "6de411ff3e4b1658a413dd6181fcXXXXXXXXXXXXXXXXXXXX" | |
head "https://github.com/yourcompany/hoge.git" | |
version "0.1.0" |
REF: https://stackoverflow.com/a/12681856
Untracked files are stored in the third parent of a stash commit. (This isn't actually documented, but is pretty obvious from The commit which introduced the -u feature, 787513..., and the way the rest of the documentation for git-stash phrases things... or just by doing git log --graph stash@{0})
You can view just the "untracked" portion of the stash via:
git show stash@{0}^3
The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
set -euo pipefail is short for:
set -e
set -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
#!/usr/bin/env bash | |
set -x | |
shopt -s extglob dotglob | |
cd "$HOME" | |
rm -rf "$HOME/TEMP_DIR" | |
mkdir "$HOME/TEMP_DIR" | |
cd "$HOME/TEMP_DIR" | |
git init |
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 | |
readonly DB_FILE="$(pwd)/images.db" | |
readonly IMG_DIR="$(pwd)/images" | |
save-images() { | |
echo "Create ${DB_FILE}" | |
echo "$(docker images|grep -v 'IMAGE ID'|awk '{printf("%s %s %s\n", $1, $2, $3)}'|column -t)" > "${DB_FILE}" | |
echo "Read ${DB_FILE}" |
NewerOlder