Skip to content

Instantly share code, notes, and snippets.

View aleferreiranogueira's full-sized avatar
🦜

Alexandre Ferreira Nogueira aleferreiranogueira

🦜
View GitHub Profile
@aleferreiranogueira
aleferreiranogueira / gist:77d6fd9466130a005d541d9bbd63b9ed
Created June 9, 2020 11:31
Enable FN keys KeychronK2 (Ubuntu)
echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
@aleferreiranogueira
aleferreiranogueira / phpcs_cbf.sh
Last active June 14, 2022 06:42
Install PHPCBF and PHPCS
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
curl -L http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o php-cs-fixer
# Those files should be either on /usr/local/bin or /usr/bin depending on your machine
sudo mv phpcbf.phar /usr/local/bin/phpcbf
sudo mv phpcs.phar /usr/local/bin/phpcs
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
sudo chmod a+x /usr/local/bin/php-cs-fixer
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
@aleferreiranogueira
aleferreiranogueira / mockery.php
Created November 10, 2017 17:07
Mockery example
$user = [
"username" => $post['username'],
"password" => $post['password'],
"name" => $post['name'],
];
// Simple Mock
$mock_class = SomeDamnClass::class;
$mock = Mockery::mock($nero_class);
$mock->shouldReceive('getUserByUsername')