Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
@rameerez
rameerez / kamal-production-server-setup.sh
Last active May 8, 2025 10:20
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---

My Stripe Tax Story

I've been debating for weeks whether or not I was going to write any of this down. I'm a dad with two kids and a house to take care of and a business to run. Adding story-telling like this to my plate is exhausting.

Until yesterday, I had decided to forget about the whole thing, until I received the email that broke the camels back, as it were.

The best way I can describe why I'm writing this email is for the same reason why you might spend two hours dealing with an uncooperative mobile phone carrier to get them to remove that $5 charge on your bill that shouldn't be there. Some combination of the feeling of frustration and injustice that really pushes my proverbial buttons.

In this particular case, the "$5 charge on my phone bill" turned out to be literally hundreds of recurring subscription invoices that Stripe disabled collection for because, apparently, those subscriptions required "location inputs".

Generally speaking, I don't blog much anymore, and the last thing I wa

@solnic
solnic / bare-bone-fp-ruby-objects.rb
Created June 3, 2021 21:03
Bare bone, no-library, no-error handling, just the very core idea behind FP objects in Ruby
class CreateStuff
def initialize(stuff_repo)
@stuff_repo = stuff_repo
end
def call(params)
@stuff_repo.create(params)
end
end

Senior Backend Developer at Devengo

Devengo is a startup focused on a simple but ambitious mission: make finance a fairer place. Founded by well-known fintech players Fernando Cabello-Astolfi and Alberto Molpeceres our first product is an innovative social benefit that allows workers to collect their earned wages in real-time. Your money, when you need it.

The problem

Economists identify¹ three main challenges any person and household must face to reach a sustainable level of financial wellness: having sufficient and stable income, maintaining an economic-financial balance that limits problems of overindebtedness and avoiding severe poverty.

The last two challenges are the most pressing ones as they have an immediate effect on the material living conditions of the population and they compound over time sinking the households' economies further and further.

In Spain al

@tobi
tobi / kindle.rb
Last active September 25, 2022 02:37
Download your Kindle Highlights to local markdown files. Great for Obsidian.md.
#!/usr/bin/env ruby
# gem install active_support
require 'active_support/inflector'
require 'active_support/core_ext/string'
# gem install webrick (only ruby3)
require 'webrick'
# gem install mechanize
@lostfictions
lostfictions / linux-streaming-setup.md
Last active April 16, 2023 02:22
Script to set up (and tear down) PulseAudio sinks for streaming to Discord or Twitch (including, optionally, via a capture device)

A Somewhat Better Setup for Streaming from Linux

I couldn't find a great way to set up streaming to Discord or Twitch from Linux, so I wrote this.

Intro

The script included below, streaming.sh, is meant to be used in tandem with the PulseAudio Volume Control application (pavucontrol, which is available in repositories for most distributions that use Pulse but might not be installed by default). It adds two PulseAudio "sinks" (destinations) that you can

@navarrothiago
navarrothiago / README.md
Last active May 1, 2025 14:15
Turn your smartphone or tablet camera into a WebCam to make video conference in Linux
require 'logger'
require 'byebug'
require 'dry/monads'
require 'dry/monads/do'
require 'dry/matcher/result_matcher'
module Dry
module Transaction
module Steps
@egelev
egelev / connect_bluetooth_headphones.sh
Last active April 10, 2025 17:45
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@caseywatts
caseywatts / 0-self-publishing.md
Last active April 29, 2025 10:17
Self-Publishing via Markdown