Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄
______ is best pony.​

Hugo Locurcio Calinou

🦄
______ is best pony.​
View GitHub Profile
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
@Calinou
Calinou / no-agc.sh
Last active Sep 14, 2020
Disable/bypass PulseAudio automatic gain control
View no-agc.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
while sleep 0.1; do
# Use `pacmd list-sources` to get the input source name.
# 65535 is 100% volume.
pacmd set-source-volume alsa_input.pci-0000_00_1f.3.analog-stereo 40000
done
@Calinou
Calinou / matterbridge.toml
Last active Sep 11, 2020
Godot Discord-IRC bridge configuration (Matterbridge)
View matterbridge.toml
[irc]
[irc.freenode]
Server="irc.freenode.net:6697"
Nick="GDDiscord"
NickServNick="GDDiscord"
NickServPassword="SECRET"
UseTLS=true
UseSASL=true
SkipTLSVerify=false
EditDisable=false
@Calinou
Calinou / sftgan.sh
Last active Aug 16, 2020
Shell script to prepare images and upscale them using SFTGAN
View sftgan.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
SFTGAN_DIR="/home/hugo/Documents/Git/xinntao/SFTGAN"
print_header() {
echo -e "\n\e[1m[*] $1\e[0m"
}
@Calinou
Calinou / clang-format.sh
Created Mar 3, 2020
Portable shell script to format all files in a folder recursively using clang-format
View clang-format.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
find . \( -name '*.cpp' -o -name '*.hpp' -o -name '*.c' -o -name '*.h' \) \
-exec clang-format -i {} \;
@Calinou
Calinou / fade-to-black.sh
Created Jan 11, 2020
Generate a set of PNG frames that fade towards black
View fade-to-black.sh
#!/bin/bash
START=599
for i in {600..700}; do
brightness="$((700-i))"
convert "$START.png" -modulate "$brightness%" "$i.png" &
done
@Calinou
Calinou / scaling.gd
Last active May 10, 2019
[WIP] Automatic hiDPI scaling handling singleton for Godot
View scaling.gd
# Copyright © 2019 Hugo Locurcio and contributors - MIT License
#
# This script implements constant 2D scaling with basic hiDPI display detection.
# This is primarily intended for application GUIs, rather than games.
extends Node
func _ready() -> void:
get_viewport().connect("size_changed", self, "_on_window_size_changed")
_on_window_size_changed()
@Calinou
Calinou / godot-init
Last active Apr 21, 2019
Scripts to initialize and edit a Godot project for quick testing
View godot-init
#!/bin/bash
#
# For Linux and macOS.
# The Godot editor must be in your `PATH` as `godot` for this script to work.
# Licensed under CC0 1.0 Universal.
set -euo pipefail
IFS=$'\n\t'
if [[ ! "${1:-}" || "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
You can’t perform that action at this time.