Skip to content

Instantly share code, notes, and snippets.

View Calinou's full-sized avatar
🦄
______ is best pony.​

Hugo Locurcio Calinou

🦄
______ is best pony.​
View GitHub Profile
@Calinou
Calinou / brotli_static.sh
Created April 30, 2018 17:54
Compress static assets to Brotli (usable by nginx's brotli_static module)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
DIR=${1:-}
if [[ "$DIR" == "" ]]; then
echo "Usage: $(basename $0) <path>"
exit 1
@Calinou
Calinou / godot_mingw.sh
Last active July 8, 2023 23:17
Compile Godot using MinGW and generate Windows installers using InnoSetup (from Linux)
#!/bin/sh
set -euo pipefail
# Number of CPU threads to use for building
# Use `./godot_mingw.sh <number of threads>` to specify
THREADS=$1
# Godot Git clone path
GODOT_PATH="$HOME/Documents/Git/godotengine/godot"
@Calinou
Calinou / camera.gd
Last active July 12, 2019 05:27
Freelook camera script from my Sponza demo
# Copyright © 2017 Hugo Locurcio and contributors - MIT license
# See LICENSE.md included in the source distribution for more information.
extends Camera
const MOVE_SPEED = 0.5
const MOUSE_SENSITIVITY = 0.002
onready var speed = 1
onready var velocity = Vector3()
onready var initial_rotation = PI/2
@Calinou
Calinou / render.bat
Created October 15, 2017 23:04
Render my avatar into PNGs of several sizes
@ECHO OFF
mkdir "dist\"
for /L %%a in (24, 24, 480) do (
convert -scale %%a "src\avatar-foreground.png" "%TMP%\avatar-foreground-%%a.png"
"%PROGRAMFILES%\Inkscape\inkscape.exe" "src\avatar-background.svg" --export-width %%a --export-height %%a --export-png "%TMP%\avatar-background-%%a.png"
composite "%TMP%\avatar-foreground-%%a.png" "%TMP%\avatar-background-%%a.png" "%TMP%\avatar-%%a.png"
oxipng -o6 "%TMP%\avatar-%%a.png"
copy "%TMP%\avatar-%%a.png" "dist\avatar-%%a.png"
@Calinou
Calinou / keybase.md
Created October 15, 2017 20:06
Keybase proof

Keybase proof

I hereby claim:

  • I am calinou on github.
  • I am calinou (https://keybase.io/calinou) on keybase.
  • I have a public key ASBWFkyj4HxyO42KjpXXu-CEFDsgWgpMXTIBW6EvTxGTcwo

To claim this, I am signing this object:

@Calinou
Calinou / mapper.sh
Last active March 9, 2022 00:54
Script to create a map of a Minetest world (then optimize it using oxipng)
#!/bin/bash
set -euo pipefail
MAP_DIR="/home/hugo/.minetest/worlds/calinou"
TEMP_FILE="/tmp/map_calinou.png"
OUTPUT_FILE="/var/www/games.hugo.pro/minetest/map_calinou.png"
echo "Rendering map, this may take a while…"
/usr/local/bin/minetestmapper \
@Calinou
Calinou / minetest.service
Last active June 17, 2022 18:45
Minetest server systemd service file, put in /etc/systemd/system/minetest.service
[Unit]
Description=Minetest
[Service]
Type=simple
User=hugo
Group=hugo
ExecStart=/usr/local/bin/minetestserver --gameid minetest_game --config /home/hugo/.minetest/configs/calinou.conf
Restart=on-failure
@Calinou
Calinou / godot_android.bat
Created September 9, 2017 20:25
Compile Godot for Android (from Windows)
@ECHO OFF
set threads=%NUMBER_OF_PROCESSORS%
call scons platform=android tools=no target=release_debug verbose=no warnings=no progress=no -j%threads%
call scons platform=android tools=no target=release verbose=no warnings=no progress=no -j%threads%
cd platform\android\java\
call gradlew build
@Calinou
Calinou / cmd-calinou-colors.reg
Created September 7, 2017 17:16
Color schemes for the Windows Command Prompt and Windows PowerShell
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:00242424
"ColorTable01"=dword:00FFAA77
"ColorTable02"=dword:0077EE77
"ColorTable03"=dword:00EEEE77
"ColorTable04"=dword:007777FF
"ColorTable05"=dword:00EE77EE
"ColorTable06"=dword:0077EEEE
@Calinou
Calinou / .rtorrent.rc
Created September 3, 2017 15:12
rTorrent configuration file
scgi_port = 127.0.0.1:5000
dht.mode.set = on
protocol.pex.set = yes
trackers.use_udp.set = yes
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 250
throttle.min_peers.normal.set = 20
throttle.max_peers.normal.set = 60