View link.sh
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/sh | |
set -eu | |
print_help () | |
{ | |
printf "Link dot files\n" | |
printf "Usage: link.sh [--dry-run]\n" | |
} | |
if echo " $* " | grep -E ' (-h|--help) ' |
View gist:0aadd13d80ee7327f6dbd2ff9b3767a1
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
I am attesting that this GitHub handle marek-saji is linked to the Tezos account tz1d3J15MX3hWjEkT447G1Lzdrh7hqXmQRbU for tzprofiles | |
sig:edsigu5Dhfptkbx2Zr1dzt12WySVUYbEfBXuQyFsFK7PJNJ7xkYpX4Q2CcDf84xgHdsBqUCkgFDuifzsbkmfwvfvy2JYgGQajeH |
View .bashrc
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
MY_HOSTS="list of hosts I own" | |
_dff () | |
{ | |
local df | |
df="$( | |
TAIL=+1 | |
{ | |
echo / | |
echo /tmp |
View git-daily
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/sh | |
# | |
# Display a summary of what you’ve been working on since yesterday | |
# Copyright 2020 Marek Augustynowicz | |
# Licensed under ISC license <https://opensource.org/licenses/ISC> | |
# | |
# https://gist.github.com/marek-saji/fd107bbd01d5436ca751effec335dae4 | |
# GistID: fd107bbd01d5436ca751effec335dae4 | |
set -e |
View git-daily
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/sh | |
# | |
# Display a summary of what you’ve been working on since yesterday | |
# | |
set -e | |
HEADER_FORMAT="\n\033[34m# %s\033[0m\n" | |
GIT_LOG_FORMAT="$( git config --get pretty.me --default="%C(green)(%cd) %C(reset)%s%C(yellow)%d %C(red)%h%C(reset)" )" |
View tree-stderr.sh
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/sh | |
foo () | |
{ | |
echo stdout | |
echo stderr 1>&2 | |
return 1 | |
} | |
{ |
View foo.php
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
<?php | |
ini_set('display_errors', true); | |
for ($i = 1; $i <= 4; $i += 1) | |
{ | |
echo 'out', $i, PHP_EOL; | |
if ($stderr = fopen('php://stderr', 'a')) | |
{ | |
fprintf($stderr, "err{$i}\n"); | |
} | |
} |
View fib2.sh
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/sh | |
# GistID: 119ae9d2166958f931b619776f835898 | |
set -e | |
minus2= | |
minus1= | |
for i in $( seq 0 $(( $1 - 1 )) ) | |
do | |
if [ -z "$minus2" ] || [ -z "$minus1" ] | |
then |
View rmv.sh
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
rmv () | |
{ | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: rmv [RSYNC_OPTIONS] SOURCE... TARGET"; | |
return 64; | |
fi; | |
local argv=("$@"); | |
local target="${argv[${#argv[@]}-1]}"; | |
unset "argv[${#argv[@]}-1]"; | |
[ -e "${target}" ] || mkdir -p "${target}"; |
View random-emoji.sh
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
EMOJI_JSON="$( curl -s https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json )" | |
RANDOM_EMOJI_DATA="$( | |
echo "${EMOJI_JSON}" | | |
jq -r '.[] | (.unified + "\t" + .short_name )' | | |
sort -R --random-source=<( for I in $( seq 1 1000 ); do echo "$SEED$I" | sha1sum; done ) | | |
head -n1 | | |
sed -r 's/^|-/\\U/g' | |
)" | |
RANDOM_EMOJI="$( echo -e "${RANDOM_EMOJI_DATA}" | cut -f1 )" | |
RANDOM_EMOJI_NAME="$( echo -e "${RANDOM_EMOJI_DATA}" | cut -f2 )" |
NewerOlder