Skip to content

Instantly share code, notes, and snippets.

View rubenhortas's full-sized avatar
:octocat:

Rubén Hortas rubenhortas

:octocat:
View GitHub Profile
@rubenhortas
rubenhortas / nlayer_overview.md
Created March 14, 2026 11:53
N-Layer architecture overview

N-Layer architecture overview

N-Layer (or Multi-Tier) architecture is a software architectural pattern where responsibilities are separated into distinct logical layers. This promotes separation of concerns, making the application easier to maintain, scale, and test.

1. Presentation Layer (UI)

The top-most level of the application. Its primary responsibility is to handle the interaction between the user and the software.

@rubenhortas
rubenhortas / .clang-format
Last active February 19, 2026 19:36
Standard C style rules
---
# Apply to project: Place in the project root directory
# Apply globally: Place in ~/
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
IndentWidth: 4
TabWidth: 4
PointerAlignment: Right
AllowShortBlocksOnASingleLine: Never
@rubenhortas
rubenhortas / steven_black_hosts_updater.py
Last active February 20, 2026 10:34
Steven Black Hosts Updater
#!/usr/bin/env python3
"""
Steven Black Hosts Updater
This script automates the process of updating the system's hosts file using
the curated lists provided by Steven Black in https://github.com/StevenBlack/hosts
Requirements:
1. A Steven Black hosts file in /etc/hosts
@rubenhortas
rubenhortas / pyproject.toml
Last active March 11, 2026 20:25
Ruff style rules for python projects
# Apply to project: Place in the project root directory
# Apply globally: Place in ~/.config/ruff/pyproject.toml (or configure in ~/.config/ruff.toml)
[tool.ruff]
line-length = 160
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # Pyflakes
"I", # isort
@rubenhortas
rubenhortas / tv_show_renamer.py
Last active February 16, 2026 17:47
Utility to normalize TV show filenames
#!/usr/bin/env python3
"""
TV Show Renamer: A utility to normalize TV show filenames.
This script automates the tedious process of renaming video files from messy
tracker formats (e.g., 'Show.Name.S01E01.720p.x264-Group.mkv') into a clean,
standardized structure (e.g., 'Show Name S01E01.mkv').
KEY FEATURES:
@rubenhortas
rubenhortas / gnu_linux_console_shortcuts_cheatsheet.md
Last active February 15, 2026 00:42
GNU/Linux console shortcuts cheatsheet

GNU/Linux console shortcuts

Editing

Keys Action
TAB
CTRL+i
Autocomplete
CTRL+u Delete everything from the cursor position to the beginning of the line
CTRL+k Delete everything from the cursor position to the end of the line
CTRL+w Delete the word before the cursor
@rubenhortas
rubenhortas / git_cheatsheet.md
Last active February 15, 2026 00:41
git cheatsheet

git cheatsheet

User settings

Command Description
git config --global user.name $name Configure user name
git config --global user.email $mail Configure user email

Repository

@rubenhortas
rubenhortas / newskill_pyros_keyboard_cheatsheet.md
Last active March 14, 2026 21:06
New Skill Pyros 60% keyboard cheatsheet

NewSkill Pyros 60% keyboard cheatsheet

Keyboard combinations (or shortcuts) for the NewSkill Pyros 60% keyboard with spanish layout (es_ES).

Backlighting

Combination Action
Fn + ` Lower the brightness intensity
Fn + + Increase brightness intensity
@rubenhortas
rubenhortas / showtime.py
Last active January 20, 2026 20:57
A very lightweight Python script to download torrent files (less than X days old) from the https://showrss.info feed.
#!/usr/bin/env python3
"""
A very lightweight Python script to download torrent files (less than X days old) from the https://showrss.info feed.
Requirements:
- feedparser
"""
@rubenhortas
rubenhortas / .rtorrent.rc
Last active December 21, 2025 13:57
Optimized rTorrent configuration template with automated directory provisioning, disk space monitoring, ratio control (for public and private trackers) and handling of .torrent and [in]complete downloaded files
# Optimized rTorrent configuration template with automated directory provisioning,
# disk space monitoring, ratio control (for public and private trackers)
# and handling of .torrent and [in]complete downloaded files.
#
# Automations:
#
# - Disk management
#
# - Create instance directories
# - Set restrictive file permissions