Skip to content

Instantly share code, notes, and snippets.

What is DB ?

DB is a little wrapper around GNU parallel's sql utility for seamless interactions with your databases.

#!/usr/bin/env bash

DRIVERS=(
    influx:

A simple script to connect to remote server containers

#!/usr/bin/env bash

function parse_ssh_config() {
    # Default SSH config file location
    SSH_CONFIG="${1:-$HOME/.ssh/config}"

    # Check if config file exists

Streamline code info sharing with a set of utilities in neovim

In collaborative environment, while working with co-workers, we usually have to share information about the code to point out a specific place in the codebase.

Most of the time I share screenshot of my code using nvim-silicon but sometimes, a screenshot is not sufficient for your co-workers to fully understand the message you are trying to convey, in those cases, you will either have to provide the name of the file and the position to look at or send a full path that point directly to the correct place. I think the second option is the best for better communication of intents.

Leverage the power of ast-grep for refactoring

At work we were using f-string in python logging methods. A typical log will look like

## Bad ❌
logger = logging.getLogger(__name__)
logger.info(f"Do you not log me like this little jerk {value}")

A dirty AI generated script to replace all occurrences of logger.method(f"") with logger.method("%s") using ast-grep. The same thing can perhaps be achieved with ast-grep rules only, but I don't know well yet.

#!/usr/bin/env python3
"""
F-string to Percent-format Logger Converter
@aristidebm
aristidebm / fmpc.sh
Last active June 1, 2025 07:17
Interactive music player combining fzf + mpc + mpd
#!/usr/bin/env bash
function list_queue() {
# Function to list queue songs formatted as "[pos] artist - title"
mpc -f "\[%position%\] %artist% - %title%" playlist
}
function list_library() {
# mpc rescan
mpc update &> /dev/null && mpc -f "%file%" listall

Argument list: The underrated (neo)vim list

The argument list is so powerful that I wonder why we as vimmers are underusing it. Below are some useful use cases that I have found for the (neo)vim argument list

Arguments list for bookmarking

This bookmarking journey began with harpoon, a plugin built by a prolific YouTube content creator named Theprimeagen. The main idea is to store commonly used files needed to achieve the task at hand into a buffer for fast access. For more information, check Why harpoon?.

After that, I came across grapple. Grapple shares the same underlying concept as harpoon but is a step ahead. It provides a neat feature on top: Scope. I really like the git_branch one

@aristidebm
aristidebm / design.md
Created April 24, 2024 18:11 — forked from nateklaiber/design.md
API Client Design
@aristidebm
aristidebm / ANSI.md
Created March 25, 2024 06:57 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@aristidebm
aristidebm / harpoon-qutebrowser.md
Last active February 12, 2024 06:14
Qute-Harpoon - An implementation of ThePrimeagen's harpoon ideas inside qutebrowser

Qute-Harpoon

Qute-Harpoon is an implementation of ThePrimeagen's harpoon's ideas inside qutebrowser to enhance tabs navigation experience.

Settings

c.tabs.show = "never"
# Put new tabs at the end 
c.tabs.new_position.related = "last"