Skip to content

Instantly share code, notes, and snippets.

@ralsina
ralsina / README.md
Last active July 22, 2024 00:11
Dynamically change your VS Code theme using flavours and base16
import cadquery2 as cq
from cadquery2 import exporters
thickness = 12
width = 60
depth = 10
holes = 6
screws = 2
cable_radius = 1.6
length=135
front_h = 10
back_h =20
width = 210
fillet_s = 5
screen_h = 100
kbd_w = 200
kbd_h = 4
kbd_l = 125
#!/bin/bash -x
DEBUG=4
PUNTODEMONTAJE=/vos/sabras
rdiff-backup -v$DEBUG --print-statistics --exclude ~/.cargo --exclude ~/.local/share/Steam/ --exclude ~/.cache ~ /$PUNTODEMONTAJE/backup-$USER/
rdiff-backup -v$DEBUG --print-statistics --remove-older-than 4W /$PUNTODEMONTAJE/backup-$USER/
rdiff-backup -l /$PUNTODEMONTAJE/backup-$USER/
import subprocess
data = subprocess.check_output('xrandr').decode('utf8').splitlines()
outputs = [x for x in data if x and x[0] not in 'S \t']
def parse_output(line):
parts = line.split()
name = parts[0]
primary = 'primary' in parts
w_in_mm, h_in_mm = [p.split('mm')[0] for p in parts if p.endswith('mm')]
res_x, res_y = [p for p in parts if 'x' in p][0].split('+')[0].split('x')

The Pleasures of a Cheap Phone

When it comes to phones I am a cheap guy. I don't buy expensive phones, I don't buy flagship phones, I don't even buy "cheap flagship-like phones". I don't buy unknown chinese brands that make amazingly cheap but awesome phones, I don't buy mid-range phones, I don't buy mistery phones. I buy cheap phones. Or at least that is the plan from now on.

My previous phone was a former flagship, a LG G4

@ralsina
ralsina / slides.tmpl
Last active May 18, 2022 07:41
A gallery slideshow shortcode for Nikola
## Nikola slides shortcode
## Put it in shortcodes/ in your site
## Use it like this:
## {{% slides "foo" %}}
## That will create a carousel with all the images from galleries/foo
## This uses bootstrap4 so only works in themes that use it
## Twek as needed for visuals
<%!
import os
@ralsina
ralsina / layout.py
Created March 23, 2018 18:03
Exploratory work
import svgwrite
class Box():
def __init__(self, x=0, y=0, w=1, h=1, red=False, blue=False, yellow=False, letter=None):
self.x = x
self.y = y
self.w = w
self.h = h
self.red = red
self.blue = blue

Viaje a Pycon Colombia

La Ida

Digamos que teníamos un itinerario ... subóptimo.

Salí de casa hacia Aeroparque el miércoles 7 a la 1PM para mi vuelo en LATAM de las 5PM a Sao Paulo. Arrancó bárbaro, llegué bien sin tráfico, pedí un café, hice el checkin en la máquina automática, me encontré con Andrew... todo sobre ruedas.

@ralsina
ralsina / Colas, techos y lluvia.md
Last active August 30, 2017 18:29
Colas, techos y lluvia

El otro día, un compañero de laburo sacó una foto y puso este tweet:

Medio "anden" vacío pero te hacen fila para la calle. Genios del universo. pic.twitter.com/CnpR4Q7qIX

— Alejandro Pernin (@alepernin) 24 de agosto de 2017

Ya había visto otros parecidos antes, así que me pareció una cosa interesante para analizar un cacho, porque para eso uno es nerd, vio?

En breve, la intriga es: