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 / dinosaur-planet-60-fps.md
Last active February 5, 2024 17:46
Running Dinosaur Planet at 60 FPS – instructions and caveats
@Calinou
Calinou / update-godot-3.x.sh
Last active November 11, 2023 18:52
Update, build and install Godot from source on Linux
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
SCONS_FLAGS=(
"lto=full"
"progress=no"
"debug_symbols=no"
)
@Calinou
Calinou / gd-pr-test.sh
Last active October 4, 2023 19:28
Test a Godot pull request locally
#!/usr/bin/env bash
#
# Tests a Godot pull request locally, given an URL to a pull request (or its
# number) and a path or URL to a testing project. This script can also be used
# to confirm Godot bug reports locally using "master" as the first argument.
#
#### Installation
#
# Save this script to a file in your PATH (such as `/usr/local/bin/gd-pr-test`),
# then make the file executable using `chmod +x /path/to/script`.
@Calinou
Calinou / .htaccess
Last active September 26, 2023 12:08
Apache configuration to serve precompressed Brotli files. Precompression script: https://gist.github.com/Calinou/30f21f07017d908fc74c7eccb3f469c3
## Serve precompressed Brotli files if they exist.
## Adapted from <https://stackoverflow.com/questions/46487635/how-to-serve-precompressed-gzip-brotli-files-with-htaccess>
## Make sure `RewriteBase /` is present somewhere in your .htaccess file.
# If the web browser accepts Brotli encoding...
RewriteCond %{HTTP:Accept-encoding} br
# ...and the web browser is fetching a probably pre-compressed file...
RewriteCond %{REQUEST_URI} .*\.(css|html|js|svg|wasm)
# ...and a matching pre-compressed file exists...
RewriteCond %{REQUEST_FILENAME}.br -s
# ...then rewrite the request to deliver the Brotli file.
@Calinou
Calinou / static-precompress.sh
Last active September 26, 2023 12:07
Brotli precompression script for the Godot website. Apache configuration: https://gist.github.com/Calinou/fc0fe1003c95380054f0084f9476e476
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# Usage: Place the script in `htdocs/` and run `./static-precompress.sh themes/godotengine/assets`.
echo "Precompressing assets in \"$1\"..."
BROTLICOMMAND="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/brotli)"
#BROTLICOMMAND=$(which brotli)
@Calinou
Calinou / insaneBump.py
Created March 9, 2015 22:34
InsaneBump GIMP plugin (licensed under GPLv3)
#! /usr/bin/env python
from gimpfu import *
import commands
import glob
import os
import string
import subprocess
suffixes = (['diffuse', '_d'], ['specular', '_s'], ['normal', '_n'], ['height', '_h'], \
@Calinou
Calinou / update-git.sh
Last active July 8, 2023 23:25
Updates all Git repositories in a directory
#!/bin/bash
# Copyright (c) 2015 Calinou
# CC0 1.0 Universal
# <https://creativecommons.org/publicdomain/zero/1.0/>
update() {
for d in "$@"; do
test -d "$d" -a \! -L "$d" || continue
cd "$d"
@Calinou
Calinou / update-svn.sh
Last active July 8, 2023 23:25
Updates all Subversion repositories in a directory
#!/bin/bash
# Copyright (c) 2015 Calinou
# CC0 1.0 Universal
# <https://creativecommons.org/publicdomain/zero/1.0/>
update() {
for d in "$@"; do
test -d "$d" -a \! -L "$d" || continue
cd "$d"
@Calinou
Calinou / build_linux.sh
Last active July 8, 2023 23:24
Compile Godot for GNU/Linux 64-bit easily
#!/bin/sh -x
# This script compiles Godot for GNU/Linux in 64-bit.
# Place this script at the root of your Godot Git clone.
# CC0 1.0 Universal
# Build 64-bit Godot for GNU/Linux desktop, in debug and release mode
scons p=x11 -j$(nproc) verbose=no tools=yes target=release_debug openssl=builtin
scons p=x11 -j$(nproc) verbose=no tools=no target=release_debug openssl=builtin
@Calinou
Calinou / build_javascript.bat
Last active July 8, 2023 23:22
Compile Godot for HTML5 easily (from Windows)
:: This script must be run from a Windows system with the Emscripten SDK
:: installed and configured. 7-Zip and MinGW also need to be installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal
set threads=%NUMBER_OF_PROCESSORS%
:: Set MinGW path
set PATH=%PROGRAMFILES%\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\;%PATH%