Skip to content

Instantly share code, notes, and snippets.

@sebastiancarlos
sebastiancarlos / sway-toggle-casual-mode.bash
Last active November 29, 2023 20:31
sway-toggle-casual-mode
#!/usr/bin/env bash
# sway-toggle-casual-mode
green='\033[0;32m'
red='\033[0;31m'
bold='\033[1m'
reset='\033[0m'
shopt -s xpg_echo
@sebastiancarlos
sebastiancarlos / sway-swap-workspaces.bash
Last active November 26, 2023 05:09
sway-swap-workspaces.bash
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Add this to your PATH
green='\033[0;32m'
red='\033[0;31m'
bold='\033[1m'
reset='\033[0m'
@sebastiancarlos
sebastiancarlos / get-terminal-cwd.bash
Last active November 10, 2023 16:47
sway-use-workspace-cwd
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Add this to your PATH
# if calling without arguments or with -h or --help, print usage
if [[ $# -eq 0 ]] || [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
echo "Usage: get-terminal-cwd <terminal-pid>"
echo " - return the CWD of the terminal with the given PID"
@sebastiancarlos
sebastiancarlos / glibc-charset-aliases.txt
Last active November 2, 2023 12:43
Tree structure of glibc character sets and their aliases.
# Tree structure of glibc character sets and their aliases.
#
# - Generated with: print-glibc-charset-aliases.bash
# - For glibc 2.38
#
# - Format:
# TARGET
# \_ ALIAS
# \_ ALIAS
# ...
@sebastiancarlos
sebastiancarlos / runasm.bash
Last active December 15, 2024 18:36
runasm - run assembly scripts from your terminal without compiling
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Video demo: https://www.youtube.com/watch?v=kNKuRdoaNII
# runasm - Assemble, link, and run multiple assembly files, then delete them.
if [[ $# -eq 0 ]]; then
echo "Usage: runasm <file1.s> [<file2.s> ...]"
echo " - Assemble, link, and run multiple assembly files, then delete them."
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Video demo: https://www.youtube.com/watch?v=2tRyBQqJdrc
# Note: In some browsers you need to type "g/" instead of just "g" so it gets
# recognized as a URL and not as a term for the default search engine.
# source of truth for URL aliases
@sebastiancarlos
sebastiancarlos / colorcat.bash
Last active March 21, 2025 16:39
Cross-app URL aliases (like shell aliases) powered by Nginx.
#!/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
@sebastiancarlos
sebastiancarlos / rfc.bash
Last active August 21, 2024 00:46
Read RFCs from your terminal
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Video demo: https://www.youtube.com/watch?v=Ypqf2IFc62I
# rfc
# - fetches and renders an RFC into less
# - from www.rfc-editor.org
# - if called with -l/--list, lists all RFCs in descending order
@sebastiancarlos
sebastiancarlos / fonts.bash
Last active December 15, 2024 18:37
Check your OS fonts from your terminal
#!/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
@sebastiancarlos
sebastiancarlos / info-man.bash
Last active October 27, 2023 10:34
Efficient info command, interoperable man command
#!/usr/bin/env bash
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/watch?v=ISKzBlzXRWE
# Add this to your .bashrc:
# get the texinfo node for a command
# - takes a command name, like 'cat'