This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnf config-manager --add-repo /etc/yum.repos.d/remi.repo && \ | |
sudo dnf config-manager --set-enabled remi &&\ | |
sudo dnf -y install php-sodium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/bash | |
magrathea-offline &&\ | |
sudo dnf -y update &&\ | |
composer self-update &&\ | |
composer global update &&\ | |
cd ~/.vim/bundle &&\ | |
for v in `ls`; do | |
cd "$v" | |
git pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump --no-data --host=your_host --user=your_user --password=your_pass --result-file=dump_file.sql --routines your_db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throw new Error('Por favor poste o seu código em uma ferramenta apropriada para isso, como Gist ou Pastebin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -EnoHR --exclude-dir={data,vendor} "_GET|_POST|_REQUEST|_SESSION|_COOKIE" *.php|more |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('select').addEventListener('change', function () { | |
// In this example, calling a custom AJAX function I was testing | |
r = makeRequest('get', 'foo.php', true); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
function foo():void | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
function foo(?string $bar, int $baz = NULL) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
class User | |
{ | |
private $roleID; // since uninitialized it's value remains NULL | |
// Rest of the class | |
// Session object is injected for the purposes of this example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
define('MOIP_TOKEN', 'SEUTOKENDEACESSO'); | |
define('MOIP_AUTH_KEY', 'SUACHAVEDEACESSO'); | |
// Específico do MOIP | |
define('AUTH_STR', MOIP_TOKEN . ':' . MOIP_AUTH_KEY); | |
// Específico do MOIP |