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
<!-- | |
Since the markup IS the application state, using data-* attributes to keep track of some specifics would be handy. | |
Luckily, HTMX is brutally easy to extend, so we can do that in no time! | |
--> | |
<article class="message task" | |
th:id="'task'+${task.id}" | |
th:data-task="${task.id}" | |
th:data-status="${task.status.id}" | |
th:hx-put="@{/task/{id}(id=${task.id})}" | |
hx-ext="hx-dataset-include" |
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 | |
# All my gist code is licensed under the MIT license. | |
# term2plain | |
# - Convert a text file containing terminal escape sequences to plain text. | |
# - This plain text is close to the visual result of running the file in a | |
# terminal. | |
# - This is achieved by running the file in a virtual terminal (tmux) and | |
# capturing it's buffer output. |
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 | |
# All my gist code is licensed under the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=y542zPAPeG4 | |
# colorcat | |
# - cats a file, but if any line contains N hex colors, it appends the colors | |
# (rendered as ansi escape sequences) to the end of the line. | |
# - input can be stdin, a file, or a hex color in plain text |
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 | |
# Video demo: N/A (This script is so dank that YouTube took down my video without explanation) | |
# Add this to your ~/.bashrc | |
# custom fc-list | |
# - sort list | |
# - add color | |
# - format table output |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/shorts/mYfEIZFlIwo | |
# Put this in your .bashrc or something like that | |
# pretty_print_directory | |
# - replace $HOME with ~ | |
# - make everything before the last '/' green, and everything after white and | |
# bold |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/shorts/WVyqVkGYb4k | |
# Add this somewhere in ~/.bashrc | |
# write_message | |
# - write a message on the lower right corner of the terminal | |
function write_message () { | |
if [[ "$#" -eq 0 ]]; then |
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
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/watch?v=Yat95AAV5k4 | |
# from https://unix.stackexchange.com/a/217390/569343 | |
# write provided text to the terminal input | |
# (does not work in subshells) | |
# - There are some weird errors when I remove the 2>/dev/nulls, but I don't | |
# even know how to begin to fix them. | |
function write_to_input () { |
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 | |
# All my gist code is licensed under the terms of the MIT license. | |
# GREPDIST | |
# Print the number of matches in each 10% section of the file | |
# | |
# Example with grep: | |
# $ grep -c 'Napoleon' war_and_peace.txt | |
# 576 |
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
# save - Capture and reuse output of command | |
# A Bash function | |
# | |
# usage: save [file] | |
# | |
# On start of the Bash session a new temporary file is created that lives as | |
# long as this terminal session lives. This is the default file. It's path can | |
# be looked up in the environmental variable $SAVE. Anytime `save` runs, it | |
# will lookup this variable. The first argument to `save` is a file path that | |
# will be used as $SAVE file. A manual set file won't be deleted automatically. |
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 -eu # do not proceed on error | |
if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then | |
cat <<EOF | |
Quick command to get a shell inside a running docker container. | |
Usage: dexec [container_name] [command] |
NewerOlder