Skip to content

Instantly share code, notes, and snippets.

View mauriciogofas's full-sized avatar

Mauricio Gofas mauriciogofas

View GitHub Profile
@mauriciogofas
mauriciogofas / holidays.json
Created September 3, 2024 02:53
Lista de feriados fornecida pela Brasil Api + Feriado customizado
{
"2024":[
{
"date":"2024-01-01",
"name":"Confraternização mundial",
"type":"national"
},
{
"date":"2024-02-13",
"name":"Carnaval",
@mauriciogofas
mauriciogofas / holidays.json
Created September 3, 2024 02:51
Lista de feriados fornecida pela Brasil Api
{
"2024":[
{
"date":"2024-01-01",
"name":"Confraternização mundial",
"type":"national"
},
{
"date":"2024-02-13",
"name":"Carnaval",
@mauriciogofas
mauriciogofas / mysql_debian_user.md
Created October 24, 2023 19:50 — forked from jaircuevajunior/mysql_debian_user.md
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)

‎‎​
@mauriciogofas
mauriciogofas / wp-mu-cron.sh
Created August 25, 2023 19:16 — forked from faishal/wp-mu-cron.sh
Wordpress Multisite Crontab using WP-CLI
WP_PATH="/var/www/site_path"
for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}')
do
echo $SITE_URL
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}')
do
echo $EVENT_HOOK
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1
done
done
@mauriciogofas
mauriciogofas / get_protected_property_in_objetc_array.php
Created March 30, 2023 06:47
#php get protected property in objetc array
if(!function_exists('gib_get_protected_property')){
function gib_get_protected_property($object, $property){
$reflectedClass = new \ReflectionClass($object);
$reflection = $reflectedClass->getProperty($property);
$reflection->setAccessible(true);
return $reflection->getValue($object);
}
}
@mauriciogofas
mauriciogofas / test.php
Last active March 30, 2023 06:30
Gist teste
// Teste
@mauriciogofas
mauriciogofas / gofas-disables-s3-uploads.php
Created May 26, 2022 00:51
Disables jpg jpeg png gif image upload to Amazon S3 from WP Offload plugin on the site of the multi site network where it is activated
<?php
/*
Plugin Name: Gofas Disable WP Offload S3 on this site
Plugin URI: http://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks
Description: Disables jpg jpeg png gif image upload to Amazon S3
Author: Gofas Software
Version: 0.0.1
Author URI: https://gofas.net
Network: False
*/
@mauriciogofas
mauriciogofas / perfex_hooks_list
Created January 22, 2022 14:17 — forked from skorpions2000/perfex_hooks_list
Full Perfex Hook List - For Perfex CRM Developers
File ---> application\controllers\admin\Authentication.php:
23: hooks()->do_action('admin_auth_init');
80: hooks()->do_action('after_staff_login');
107: hooks()->do_action('after_staff_login');
117: hooks()->do_action('after_staff_login');
219: hooks()->do_action('after_user_logout');
File ---> application\controllers\admin\Auto_update.php:
14: hooks()->do_action('before_perform_update', $latest_version);
@mauriciogofas
mauriciogofas / invoice_link.html
Last active September 22, 2021 21:39
Exemplo de link dinâmico para à fatura para ser utilizado na mensagem de erro personalizada do módulo Gofas Juno Cartão para WHMCS.