Skip to content

Instantly share code, notes, and snippets.

View Lyokolux's full-sized avatar
🦄
Building something

Lyokolux Lyokolux

🦄
Building something
View GitHub Profile
@Lyokolux
Lyokolux / CurveCollision.java
Created January 23, 2022 18:29
Collision calculation for a ball on a curve. It finds the closest point to the ball on the curve and checks if there is a collision between between them.
public static double curveCollision(Vecteur ballPosition, double ballRadius, Vecteur vitesse, final Vecteur startPoint, final Vecteur controlPoint, final Vecteur endPoint) {
Vecteur closestPointToBall = getClosestPointToCubicBezier(
ballPosition, startPoint, controlPoint, endPoint
);
double distanceWithBall = Math.sqrt((ballPosition.x - closestPointToBall.x) * (ballPosition.x - closestPointToBall.x) + (ballPosition.y - closestPointToBall.y) * (ballPosition.y - closestPointToBall.y));
if (distanceWithBall > ballRadius + 10) {
return 0;
} else {
@Lyokolux
Lyokolux / libreoffice-the-floppy-disk-icon-has-disappeared.md
Last active June 27, 2020 11:01
Translation of the article of Genma : Libreoffice - l’icône disquette a disparu ! (https://blog.genma.fr/?Libreoffice-l-icone-disquette-a-disparu) in english

This is a translation of the original article : Libreoffice - l’icône disquette a disparu ! written by Genma on https://blog.genma.fr.

Libreoffice - the floppy disk icon has disappeared!

It was while working on a document in Libreoffice and recording it that I noticed one thing: the disappearance of the floppy disk icon for recording, replaced by something else.

In red if the document has been modified and not saved :

Red icon file if the document is not registered

@Lyokolux
Lyokolux / sms.py
Created July 10, 2019 20:49
A tool to send SMS with the Free ISP. Use bash CLI.
import sys
import click
import json
from urllib.request import urlopen
from urllib.parse import quote
RESPONSES_CODE = {
200 : "SMS sent",
400 : "One parameter is missing (identifier, password or message).",
import os
import pathlib
# Usage :
# for filename in walker(ROOT_PATH):
# code...
def walker(path):
for (_, dirs, files) in os.walk(path):
for name in files: