Skip to content

Instantly share code, notes, and snippets.

View LeonLenclos's full-sized avatar
('<_ '

Léon LeonLenclos

('<_ '
View GitHub Profile
LeonLenclos /
Last active March 27, 2019 15:42
Fill the terminal with shades of blue.
Fill the terminal with shades of blue.
require the color module (`$ pip install color`).
from random import choice
from shutil import get_terminal_size
from color import cyan, blue, magenta
LeonLenclos /
Last active October 21, 2020 15:17
Inkscape to print
  1. Save the document from inkscape foo.svg
  2. Convert the svg to pdf : rsvg-convert -f pdf -o foo.pdf foo.svg
  3. Convert the pdf to a cmyk pdf gs -o foo-cmyk.pdf -sDEVICE=pdfwrite -sProcessColorModel=DeviceCMYK -sColorConversionStrategy=CMYK -dOverrideICC foo.pdf

Check conversions : pdfimages -list foo-cmyk.pdf

LeonLenclos / utils.lua
Last active January 31, 2021 01:11
Lua/Love utils
local utils = {}
-- My utils functions for developing games with Love2d
-- Numbers
function utils.mapvalue(val, min, max, mapmin, mapmax)
return ((val-min)/(max-min))*(mapmax-mapmin)+mapmin
function utils.constrain(val, min, max)
LeonLenclos / game.txt
Created January 26, 2021 15:08
LeonLenclos / index.html
Created April 4, 2021 13:48
lovejs index.html for
<!doctype html>
<html lang="en-us">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>The Mission</title>
body, html, canvas {
LeonLenclos / face.logo
Last active May 27, 2021 12:51
logo face ('<_ '
LeonLenclos /
Last active January 6, 2022 09:03
Download drawings from
# Run this script to download drawings.
# You can then put all the drawing to the same size with imagemagick.
for f in *.png; do convert $f -gravity CENTER -extent 1920x1080 $f; done;
# And make a video from them with ffmpeg.
ffmpeg -r 25 -f image2 -s 1920x1080 -pattern_type glob -i "*.png" -vcodec libx264 -crf 25 -pix_fmt yuv420p anim.mp4
import urllib.request