Skip to content

Instantly share code, notes, and snippets.

View Einenlum's full-sized avatar

Yann Rabiller Einenlum

View GitHub Profile
@Einenlum
Einenlum / vercel.json
Created May 7, 2023 13:48
Redirect a custom domain on Vercel to another specific page from the internet
{
"redirects": [
{
"source": "/(.*)",
"has": [
{
"type": "host",
"value": "www.mydomain.io"
}
],
@Einenlum
Einenlum / sidebyside.py
Created August 3, 2022 14:53
A python function to take a list of words and print them in two columns side by side
# I needed a way to print two columns of words based on a list and a number of spaces.
# I couldn't find an easy solution, so I made this function. Maybe it can be useful to someone.
from typing import List
def outputs(words: List[str], spaces: int) -> str:
"""
Takes a list of words and returns two columns of words separated by spaces.
@Einenlum
Einenlum / strict.sh
Created May 10, 2022 12:13
Easily add strict_types to all PHP files not having it (with ripgrep and sed)
# rg --files_without_match returns all the files that don't have "strict_types" in them
# rg --type php filters only php files
# '3 i' insert the following at the third line
files=$(rg --type php strict_types --files-without-match) && echo $files | xargs sed -i '3 i declare(strict_types=1);\n'
@Einenlum
Einenlum / light.sh
Created January 19, 2022 00:26
Script to use xbacklight and prevent full black screen
#!/bin/sh
val=$(xbacklight -get)
increase_light() {
# Try to be a bit progressive when in low brightness
if [ $val -le 20 ] ; then
percent=2
else
percent=5
@Einenlum
Einenlum / vimtutor-bepo-1-7
Last active February 5, 2024 12:38
Vimtutor 1.7 pour BÉPO.
===============================================================================
= B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 =
===============================================================================
Vim est un éditeur très puissant qui a trop de commandes pour pouvoir
toutes les expliquer dans un cours comme celui-ci, qui est conçu pour en
décrire suffisamment afin de vous permettre d'utiliser simplement Vim.
Le temps requis pour suivre ce cours est d'environ 25 à 30 minutes, selon
le temps que vous passerez à expérimenter.