Skip to content

Instantly share code, notes, and snippets.

@sebastiancarlos
sebastiancarlos / girls_and_boys.pro
Last active January 8, 2025 03:40
Blur's "Girls and Boys" lyrics generator in Prolog
#!/usr/bin/env swipl --quiet
% All my gist code is licensed under the MIT license.
:- use_module(library(clpfd)).
% ORIGINAL LYRICS:
% Looking for
% Girls who want boys
% Who like boys to be girls
@sebastiancarlos
sebastiancarlos / fdisk-color.bash
Last active December 17, 2024 18:36
Custom version of the "fdisk" command, with color.
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/watch?v=Dl2n_fcDjkE
### Add this to your .bashrc
# custom fdisk
# - add color when called with -l or -x
# - prepend sudo
function fdisk () {
@sebastiancarlos
sebastiancarlos / manpdf.sh
Last active December 15, 2024 18:42
manpdf - Turn your man pages into PDF - No one man should have all that power™️ 🔥💪🍆👀
#!/usr/bin/env bash
# Created by argbash-init v2.10.0
# ARG_OPTIONAL_SINGLE([output],[o],[The output file])
# ARG_OPTIONAL_BOOLEAN([open-pdf],[],[Open the PDF file after creating it],[on])
# ARG_POSITIONAL_SINGLE([name-or-file])
# ARG_POSITIONAL_SINGLE([section],[],[""])
# ARG_DEFAULTS_POS([])
# ARG_HELP([<Open a man page as a PDF file>])
# ARG_VERSION([echo $(basename $0) 420.69])
@sebastiancarlos
sebastiancarlos / shelloptions.sh
Last active December 15, 2024 18:42
shelloptions - combine output of "set -o" and "shopt", thereby showing all Bash options in one place
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/watch?v=eN4_nmREzCQ
# copy this to your .bashrc or something like that
# shelloptions
# combine output of "bind -V", "set -o" and "shopt", thereby showing all shell
# options in one place. Display nicely with color and column alignment.
#
@sebastiancarlos
sebastiancarlos / commands.sh
Last active December 15, 2024 18:41
commands - list all commands in your PATH, and their directories
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/9sKEQ-DFL8I
# commands
# - list all commands in your PATH, and their directories
function commands () {
local green='\x1b[32m'
local reset='\x1b[0m'
@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 / 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."
@sebastiancarlos
sebastiancarlos / silence-autocd.sh
Last active November 15, 2024 07:55
Hack to suppress the default output of autocd in Bash.
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/ojhaUNYetsU
shopt -s autocd
# silence_autocd
# - Hack to stop autocd from printing the directory after autocd'ing.
# - Unfortunately there is no clean way to do this except messing with
# BASH_XTRACEFD, a poorly understood file descriptor that we are better not
@sebastiancarlos
sebastiancarlos / toggle_jobs.bash
Last active October 23, 2024 19:25
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@sebastiancarlos
sebastiancarlos / bible.json
Created August 22, 2022 16:39
New Revised Standard Version Updated Edition (NRSVUE) of the Bible in JSON
This file has been truncated, but you can view the full file.
{
"Old Testament": {
"Genesis": {
"1": {
"1": "¹ When God began to create the heavens and the earth, ",
"2": "² the earth was complete chaos, and darkness covered the face of the deep, while a wind from God swept over the face of the waters. ",
"3": "³ Then God said, “Let there be light,” and there was light. ",
"4": "⁴ And God saw that the light was good, and God separated the light from the darkness. ",
"5": "⁵ God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day. \n",
"6": "⁶ And God said, “Let there be a dome in the midst of the waters, and let it separate the waters from the waters.” ",