Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄
______ is best pony.​

Hugo Locurcio Calinou

🦄
______ is best pony.​
View GitHub Profile
@Calinou
Calinou / README.md
Created Feb 20, 2021
Configuration for running git-code-debt on the Godot repository
View README.md
  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 https://github.com/asottile/git-code-debt for more information.

@Calinou
Calinou / download-all.sh
Created Jan 28, 2021
Script to download all Godot artifacts for a release from TuxFamily (for mirroring purposes)
View download-all.sh
#!/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 Jan 23, 2021
Increase NVIDIA power limit with the proprietary driver on Linux, from 200W to the maximum 216W on a GeForce GTX 1080
View README.md

Instructions

  • Save nvidia-tdp.service and nvidia-tdp.timer to /etc/systemd/system.
  • Run sudo systemctl daemon-reload && sudo systemctl enable nvidia-tdp && sudo systemctl start nvidia-tdp to apply immediately and on future boots.
@Calinou
Calinou / script.py
Last active Jan 15, 2021
Python template for utilities and helper scripts
View script.py
#!/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 Jan 3, 2021
Brotli precompression script for the Godot website. Apache configuration: https://gist.github.com/Calinou/fc0fe1003c95380054f0084f9476e476
View static-precompress.sh
#!/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 Jan 9, 2021
Apache configuration to serve precompressed Brotli files. Precompression script: https://gist.github.com/Calinou/30f21f07017d908fc74c7eccb3f469c3
View .htaccess
## 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 / autoexec.cfg
Last active Jan 28, 2021
My configuration file for Counter-Strike: Global Offensive
View autoexec.cfg
// Make the viewmodel take less space on the screen by moving it towards the bottom right corner.
viewmodel_fov 54
viewmodel_offset_x 2.5
viewmodel_offset_y -2
viewmodel_offset_z -2
// Decrease viewmodel bobbing to be less distracting.
cl_viewmodel_shift_left_amt 0.5
cl_viewmodel_shift_right_amt 0.25
cl_bob_lower_amt 5
View php-fpm-enable-error-reporting.md

I was able to activate it, if anyone needs, just follow these steps:

1: edit:

sudo vim /usr/local/etc/php-fpm.d/www.conf

2: add to the end of the file:

@Calinou
Calinou / script.sh
Last active Oct 30, 2020
Bash script boilerplate (safer programming practices + allow running from any location without using `cd` beforehand)
View script.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@Calinou
Calinou / Caddyfile
Created Oct 3, 2020
Caddyfile for hosting PHP/October website locally (place in the app's root folder)
View Caddyfile
http://localhost:8000
encode gzip
php_fastcgi unix//var/run/php-fpm/www.sock
file_server