Skip to content

Instantly share code, notes, and snippets.

View FlorianLatapie's full-sized avatar
🧯
The_WolF_178

Florian Latapie FlorianLatapie

🧯
The_WolF_178
View GitHub Profile
@FlorianLatapie
FlorianLatapie / Bee movie script for variables.txt
Last active July 23, 2023 07:45
This gist contains the whole bee movie script respecting this regex [a-zA-Z0-9_] to be usable in a variable in your programs, source : https://beemovie.fandom.com/wiki/Bee_Movie/Transcript
Narrator_According_to_all_known_laws_of_aviation__there_is_no_way_that_a_bee_should_be_able_to_fly__Its_wings_are_too_small_to_get_its_fat_little_body_off_the_ground__The_bee__of_course__flies_anyway_because_bees_don_t_care_what_humans_think_is_impossible___Cut_to_Barry_s_room__where_he_s_picking_out_what_to_wear__BarryYellow__black__Yellow__black__Yellow__black__Yellow__black__Ooh__black_and_yellow_Yeah__let_s_shake_it_up_a_little___Barry_uses_honey_from_a_dispenser_to_style_his_hair__rinse_his_mouth__and_then_applies_it_to_his_armpits__Mom__Janet_Benson__calling_from_downstairs___Barry_Breakfast_is_ready_Barry_Coming__phone_rings__Oh__hang_on_a_second___adjusts_his_antennas_into_a_headset__Hello_Adam_Flayman_on_the_phone__Barry_Barry_Adam_Adam_Can_you_believe_this_is_happening_Barry_I_can_t_believe_it__I_ll_pick_you_up___hangs_up__sharpens_his_stinger__Lookin__sharp___flies_downstairs__Mom_Barry__why_don_t_you_use_the_stairs_Your_father_paid_good_money_for_those__Barry_Sorry__I_m_excited__Dad__Martin_Benson
@FlorianLatapie
FlorianLatapie / palin13.py
Last active July 23, 2023 08:39
This script prints words that are still words when rot13 is applied.
from unidecode import unidecode
import codecs
def rot13(mot):
return codecs.encode(mot, 'rot_13')
def string_set_from_file(file_path, encoding="utf-8"):
try:
@FlorianLatapie
FlorianLatapie / imgzipper-golfed.py
Last active December 30, 2022 17:01
This script creates a zip file with the images asked by the user (two files : golfed and readable)
import os, sys, requests, json, shutil
results = json.loads(requests.request("GET", "https://imsea.herokuapp.com/api/1?q=" + sys.argv[1]).text)["results"]
os.path.exists(sys.argv[1] + "/") or os.makedirs(sys.argv[1] + "/")
[open(sys.argv[1] + "/" + sys.argv[1] + str(i // 2 + 1) + '.png', 'wb').write(requests.get(results[i]).content) for i in
range(0, len(results), 2)]
shutil.make_archive(sys.argv[1], 'zip', sys.argv[1] + "/")
shutil.rmtree(sys.argv[1] + "/")
@FlorianLatapie
FlorianLatapie / snake.py
Last active December 30, 2022 17:01
Simple python snake using curses, on Windows use the command `pip install windows-curses` to install curses, using PyCharm IDE make sure that you enabled the "Emulate termianl in output console" option to make it work
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
# Constants
KEY_ESC = 27
height = 10
width = 40
half_height = int(height / 2)
@FlorianLatapie
FlorianLatapie / AreYouDumb.java
Last active December 30, 2022 17:00
I got lost on Instagram and wanted to recreate what I saw.
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Random;
import static javax.swing.SwingConstants.CENTER;
public class AreYouDumb extends JFrame {
private final JLabel label;
@FlorianLatapie
FlorianLatapie / mvn_win_install.cmd
Last active November 7, 2023 13:10
Apache Maven 3.8.6 auto install script for Windows *run the script with admin privileges*
@ECHO off
REM @Author Florian Latapie
echo Apache Maven auto install script for Windows & echo. & echo Downloading the zip file & echo.
curl -o tmp.zip https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip
echo Installation & echo.
powershell -command "Expand-Archive tmp.zip 'C:\Program Files\apache'"
setx /M PATH "%PATH%;C:\Program Files\apache\apache-maven-3.8.6\bin"
del tmp.zip
@FlorianLatapie
FlorianLatapie / tictactoe.py
Created June 9, 2022 14:32
Simple python Tic-tac-toe using the mouse in the terminal with curses, on Windows use the command `pip install windows-curses` to install curses
import curses
# Constants
import random
KEY_ESC = 27
X = "X"
O: str = "O"
EMPTY = " "
@FlorianLatapie
FlorianLatapie / dl_TD_lippi.sh
Created October 13, 2022 10:06
Télécharger les TDs de Lippi
echo -e "Recherche de fichiers dans http://users.polytech.unice.fr/~lippi/cpp/td/"
# source : https://stackoverflow.com/a/26269730
wget -q -r -np -nH --cut-dirs=3 -R *.html* http://users.polytech.unice.fr/~lippi/cpp/td/
# -q : silencieux
# -r : récursivement
# -np : ne pas aller dans les répertoires du dessus
# -nH : ne pas sauvegarder les fichiers dans le dossier "hostname".
# --cut-dirs=3 : sauvegarde en omettant les 3 premiers dossiers ~lippi, cpp, td
# -R *.html* : exclure les fichiers .html
echo -e "Terminé !"
@FlorianLatapie
FlorianLatapie / switch_com_dev.js
Last active December 30, 2022 17:04
Switch between .com and .dev by clicking on a bookmark with this code.
javascript:window.location.host=window.location.host.replace(/(com|dev)/,x=>"comdev".replace(x,""))
@FlorianLatapie
FlorianLatapie / go_to_gists.js
Last active December 3, 2022 19:24
Go directly to a person's GitHub Gist profile by clicking on a bookmark with this code.
javascript:window.location.href="https://gist."+window.location.href.match(/(github\.com\/[^/]+)(?:\/.*)?/)[1]