Skip to content

Instantly share code, notes, and snippets.

@besserwisser
besserwisser / .zshrc
Created May 5, 2023 08:10
codesandbox cloud (prints new links)
cscloud() {
codesandbox $1 | tee /dev/tty | tail -1 | sed -e 's/codesandbox.io\/s/codesandbox.io\/p\/sandbox/g'
}
# Usage:
# cscloud .
@besserwisser
besserwisser / .zshrc
Last active March 7, 2023 07:30
Get display on/off timestamps and differences (macos, zsh, per day)
# zsh function to get the first display on time and the last display off time of the day
# Also shows difference time difference between those both
# installation: put this function in your .zshrc file
# reload zshrc: source ~/.zshrc
# use it like this for today: when
# use it like this for yesterday: when 1
# use it like this for the day before yesterday: when 2
when() {
if ! [[ -z $1 || $1 =~ '^[0-9]+$' ]]; then