Skip to content

Instantly share code, notes, and snippets.

View xsellier's full-sized avatar
🏠
Working from home

Xavier Sellier xsellier

🏠
Working from home
View GitHub Profile
@xsellier
xsellier / transition.gd
Last active February 14, 2025 08:06
Transition effect
@tool
extends CanvasLayer
const TRANSITION_ANIMATION_DURATION = 1.0
const TRANSITION_ANIMATION_FONT_DURATION = 0.66
const TRANSITION_TYPE_LIST = [{
index = 0,
trans = Tween.TRANS_QUAD
}, {
index = 1,
shader_type canvas_item;
uniform float row_offset : hint_range(0.0, 1.0, 0.01);
uniform vec2 direction = vec2(0.77, 0.77);
uniform float speed = 10.0;
uniform float skew_amount : hint_range(-1.0, 1.0, 0.01) = 0.5;
uniform float perspective_amount = -0.5;
void fragment() {
@xsellier
xsellier / scan.sh
Last active October 7, 2021 09:33
Scan Twitch leak
for file in $(ls -1 *.zip)
do
echo "Scanning ${file}"
for filtered_file in $(zipinfo -1 "${file}" | grep "\(\.csv\|\.sql\)$" | sed -e 's/\ /@/g')
do
if [ -n "${filtered_file}" ]
then
original_filename=$(echo ${filtered_file} | sed -e 's/@/\ /g')
zipgrep -i "TWITCH_USERNAME" "${file}" "${original_filename}"
@xsellier
xsellier / AnimatedToggle.gd
Created July 29, 2021 08:50
AnimatedToggle button for Godot Engine 2.1
tool
extends TextureButton
const ANIMATION_DURATION = 0.667
const TICK_TEXTURE = preload('res://theme/blank/white-128x128-circle.tex')
const BUTTON_BACKGROUND = preload('res://theme/blank/bean-128x60.tex')
export(float, 0.1, 1.0, 0.01) var tick_ratio = 0.8 setget set_tick_ratio, get_tick_ratio
export(Color) var unselected_background = Color('#12171e') setget set_unselected_background, get_unselected_background
@xsellier
xsellier / computeSteamTags.js
Last active December 3, 2020 16:05
Install request and async npm packages first, then run `node computeSteamTags.js`
/******************************************
* PREREQ:
* NodeJS 8+
* NPM
******************************************
* USAGE:
* npm install async request
* node index.js
******************************************/
const async = require('async')
@xsellier
xsellier / godot3.2-benchmark.gd
Last active December 2, 2020 15:47
Benchmark GDScript
extends Node
export(bool) var click_to_run setget run
var outfile : File
var startusec : int = 0
var elapsed : int = 0
var testvar : int = 0
var bigarray : Array = []
func fileinit():
#!/bin/bash -e
while [ true ]
do
CURRENT_LINE_COUNT=$(git diff --shortstat | sed -e 's/,/\n\r/gi' -e 's/files changed/Fichiers modifiés/gi' -e 's/insertions/Lignes ajoutées/gi' -e 's/deletions/Lignes supprimées/gi')
echo -e "Statistiques:\n${CURRENT_LINE_COUNT}" > ~/Stream/line-count.txt
sleep 60
done
@xsellier
xsellier / gist:743ba1f214ab89259c8b2ac338670dc2
Created February 7, 2020 19:24
Debug les signaux de Godot Engine
extends Node
# ' emit_signal\(([^\n]+)*\)'
# ' debug_manager.emit_signal_debug(self, [\1])'
# ' ([^\s]+)\.emit_signal\(([^\n]+)*\)'
# ' debug_manager.emit_signal_debug(\1, [\2])'
var new_frame = true
var signals = {}
Pour avoir un projet moins ambigü, aucun fichier n'est au pluriel, tout au singulier, en vrai l'orthographe importe peu dans ces cas la.
Cette règle permet de gagner du temps lorsqu'on veut nommer des fichiers/répertoires.
nom-du-projet/
.gitignore
- config/
- default.json <= Options par défaut
- local.json <= Fichier ajouté une fois, mais ensuite mis dans le fichier .gitignore, comme ça tous les devs pourront rouler l'app localement
- custom-environment-variable.json <= Utilisé pour la prod, les variables secrètes sont des variables d'environnement, donc plus dur a récupérer en cas de hack
- lib/