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 / bottom.html
Created August 7, 2021 13:03
Backup of the syntax highlighting blocks on the Godot Q&A
<script defer src="/qa/highlightjs/highlight.min.js"></script>
<script defer src="/qa/highlightjs/highlight.gdscript.min.js"></script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightBlock(block);
});
});
</script>
@aaronfranke
aaronfranke / convert-to-godot4.sh
Last active April 2, 2024 16:20
This script bulk-renames many things in Godot 3 projects to hopefully make it easier to convert them to Godot 4.
#!/usr/bin/env bash
# This script bulk-renames many things in Godot 3 projects to hopefully
# make it easier to convert them to Godot 4. The goal is to do as much
# replacing as possible here so that the diffs Godot produces are smaller.
set -uo pipefail
IFS=$'\n\t'
# Loops through all text files tracked by Git.
@Calinou
Calinou / metric_config.yaml
Created April 28, 2021 23:01
Metrics generator for the Godot Git repository (see https://github.com/asottile/git-code-debt)
# This is a sample metric config
# Sample Groups definition:
# Groups:
# Group1:
# metrics:
# - FooMetric
# - BarMetric
# metric_expressions:
# - ^.*Baz.*$
@Calinou
Calinou / versions.json
Last active April 15, 2021 12:43
Godot versions available in JSON form (for testing the built-in update checker)
{
"releases": {
"4.1.1": {
"date": "2021-04-15",
"news_url": "https://godotengine.org/news",
"description": "Godot 3.3 has been released!\n\nThis release features significant improvements to 2D and 3D rendering, a new FBX importer, Android App Bundle support, and much more."
},
"4.1": {
"date": "2021-04-15",
"news_url": "https://godotengine.org/news",
@Calinou
Calinou / README.md
Created February 20, 2021 19:12
Configuration for running git-code-debt on the Godot repository
  1. Install Python 3.6 or later and pip then run pip install --user --upgrade git-code-debt.
  2. Save generate_config.yaml and metric_config.yaml in the same folder.
  3. Run git-code-debt-generate. This will take a few minutes.
  4. Run git-code-debt-server database.db and open the address that appears in the console output in a web browser.

See for more information.

@Calinou
Calinou / download-all.sh
Created January 28, 2021 21:51
Script to download all Godot artifacts for a release from TuxFamily (for mirroring purposes)
#!/usr/bin/env bash
# Copyright © 2019-2021 Hugo Locurcio
# Licensed under the MIT license.
set -xeuo pipefail
IFS=$'\n\t'
export DIR
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@Calinou
Calinou / README.md
Last active September 10, 2024 07:33
Increase NVIDIA power limit with the proprietary driver on Linux, from 200W to the maximum 216W on a GeForce GTX 1080

Instructions

  • Save nvidia-tdp.service and nvidia-tdp.timer to /etc/systemd/system.
  • Run sudo systemctl daemon-reload &amp;&amp; sudo systemctl enable nvidia-tdp &amp;&amp; sudo systemctl start nvidia-tdp to apply immediately and on future boots.
@Calinou
Calinou / script.py
Last active January 15, 2021 17:58
Python template for utilities and helper scripts
#!/usr/bin/env python
import os
def main() -> None:
# Change to the directory where the script is located,
# so that the script can be run from any location.
os.chdir(os.path.dirname(os.path.realpath(__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 / .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.