Skip to content

Instantly share code, notes, and snippets.

View petronioamaral's full-sized avatar

Petrônio Amaral petronioamaral

  • Dublin, Ireland
View GitHub Profile
@petronioamaral
petronioamaral / error_laravel.php
Created June 1, 2024 16:10
Vite manifest not found laravel breeze blade
Vite manifest not found laravel breeze blade
Replace
@vite(['resources/css/app.css', 'resources/js/app.js'])
TO
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}"></script>
@petronioamaral
petronioamaral / erros.php
Created May 15, 2024 22:21
Show erros PHP
<?php
ini_set('display_errors',1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);
?>
@petronioamaral
petronioamaral / translate-string-with-function.php
Created May 1, 2024 17:33
WordPress | Translate string with PHP function
<?php
// option 1, to change text site wide
add_filter( 'gettext', 'fs_translate_strings_1', 20, 3 );
function fs_translate_strings_1( $translation, $text, $domain ) {
// STRING 1
$translation = str_ireplace( 'My Old Text', 'My New Text', $translation );
// STRING 2
$translation = str_ireplace( 'Old Text', 'New text', $translation );
return $translation;
@petronioamaral
petronioamaral / hosts_para_bloquear_adobe.txt
Last active January 6, 2023 19:20
hosts para bloquear adobe
127.0.0.1 localhost
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
@petronioamaral
petronioamaral / just-microsoft-office-file-type-list.php
Created October 6, 2022 10:13
List of MIME types as PHP array
<?php
/**
* List of Microsoft office file MIME types
* @date 2014-07-09
*/
return array(
'doc'=>'application/msword',
'dot'=>'application/msword',
@petronioamaral
petronioamaral / consolelog.js
Created June 14, 2022 15:09
Save output console.log to file
// Function that will call your webserver
logToServer = function (consoleMsg) {
// only do this if on device
// if (window.cordova) {
let jsonTxt = customStringify(consoleMsg);
var xmlHttp = new XMLHttpRequest();
xmlHttp.open(
"GET",
"http://wsite.localhost/console2server.php?msg=" + jsonTxt,
true
@petronioamaral
petronioamaral / Linux Commands - Apache.md
Last active February 28, 2022 16:46
Linux Commands - Apache
Enable version php = sudo a2enmod php5.6
Disable version php = sudo a2dismod php7.3

restart = udo systemctl restart apache2

check versions enabled = ls -l mods-*/*php*
test sintaxe apache = apache2ctl configtest
change version php = sudo update-alternatives --config php
@petronioamaral
petronioamaral / composer-autoload.md
Created November 11, 2021 22:11
composer autoload

"autoload": { "psr-4": { "App\": "src/" } }

composer dump-autoload

@petronioamaral
petronioamaral / add IP to port CSF directadmin
Created October 7, 2021 17:10
add IP to port CSF directadmin
tcp|in|d=3306|s=seuip
@petronioamaral
petronioamaral / aws_ses_delete-suppressed.md
Created August 20, 2021 16:37
delete email suppression list

aws sesv2 delete-suppressed-destination --email-address [email protected] --region sa-east-1