Des bouts de trucs liés au code, que je trouve utiles de stocker quelque part (en anglais)
I found myself wanting to convert a string to a duration (int), for some configuration.
Something you can call like this:
string_to_duration("1d", target="days")
string_to_duration("1d", target="hours")
string_to_duration("3m", target="hours")
string_to_duration("3m", target="minutes")
The code :
from typing import Literal
def string_to_duration(value: str, target: Literal["days …
I’m using llm more and more, and today I had to find back prompts I used in the past. Here is a command I’ve been using, which allows me to filter the results based on what I want. It leverages sql-utils, a cli tool which is able to …
It’s been a while since I’ve used IRC, but I needed to connect to it today to discuss around Peewee.
The main issue with IRC is that you need to be connected to see the answer, and to get the context of the conversation. Unless… you set up …
Vigogne is a LLM model based on LLAMA2, but trained with french data. As I’m working mostly in french, it might be useful. The current models that I can get locally are in english.
The information I’ve found online are scarse and not so easy to follow, so …
I’m trying to get away from Github, and one thing that I find useful is the gist utility they’re providing. Seems that gitlab provides a similar tool.
You can use it using python-gitlab:
pipx install python-gitlab
And then :
gitlab snippet create --title="youpi" --file-name="snip.py" --content snip …
I wanted to create a space on my server where I can upload markdown files and have them rendered directly, for them to be shared with other people.
I stumbled on the markdown module for nginx which does exactly what I want, but seemed to ask for compilation of nginx …
Il y a plusieurs sites qui permettent de faire ça automatiquement, mais j’aime bien faire les choses depuis mon terminal, voici donc une commande qui permet de faire ça simplement, en utilisant ImageMagick. Merci à ce gist
convert -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 …
Sometimes, I need to change how the continuous integration is setup, and I find myself pushing to a branch to test if my changes are working. Oftentimes, it takes me multiple commits to find the correct configuration, which is… suboptimal.
I discovered today Gitlab CI local which makes it possible …
Pour les mises à jour Arch, j’utilise yay. Je ne fais les mises à jour que de manière semi-régulière, et parfois après une longue période je me retrouve avec des soucis de clé qui ne sont plus à jour ou manquantes.
Avec une utilisation fréquente du système, aucun problème …