This file contains hidden or 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
vim my-file.txt | |
# On VIM just type the following command to remove BOM | |
:set nobomb | |
# Saving the file | |
:wq! |
This file contains hidden or 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
Problem: PHP Artisan Tinker crashes from issuing any command and leaves no logs. | |
Solution: | |
According to developer's forum: https://github.com/bobthecow/psysh/issues/540#issuecomment-446480753 it is necessary to edit | |
the following file: | |
~/.config/psysh/config.php in case the file do not exist just create a new one vim ~/.config/psysh/config.php | |
Add the following content: |
This file contains hidden or 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
return response($myImagePath, 200)->header('Content-Type', 'image/jpeg'); |
This file contains hidden or 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
Para dar push ao Github sem precisar ficar digitando a senha a todo momento | |
$ ssh-keygen | |
→ Colocar o nome do arquivo com a chave pgp. | |
$ ssh-add | |
$ cat ~/.ssh/<nome_do_arquivo>.pub | |
copiar a chave e colocar no github na tela de configurações. |
This file contains hidden or 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
//File: app\Providers\RouterServiceProvider.php | |
// Removing prefix line | removendo a linha de prefixo | |
//Mudar | Change | |
protected function mapApiRoutes() | |
{ | |
Route::prefix('api') | |
->middleware('api') | |
->namespace($this->namespace) | |
->group(base_path('routes/api.php')); |
This file contains hidden or 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 | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel 5.5.13 on 2017-09-28. | |
* | |
* @author Barry vd. Heuvel <[email protected]> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { | |
exit("This file should not be included, only analyzed by your IDE"); |
This file contains hidden or 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 artisan cache:clear | |
php artisan view:clear | |
php artisan route:clear | |
php artisan clear-compiled | |
php artisan config:cache |
This file contains hidden or 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
-- Some say MySQL already support UUID() function as default, but old versions and MariaDB not! | |
-- In case you deal with various tables create trigger to insert UUID is not a good solution from | |
-- a manteinance point of view. | |
-- DISCLAIMER 1: For learning purposes only. It is NOT secure setting a fixed value for UUID due to obvious reasons. | |
-- DISCLAIMER 2: Use char to store UUID is not a wise solution the correct approach is to use BINARY(16). I will keep | |
-- the below solution just for very small apps. | |
CREATE TABLE 'tb_test' ( | |
'id_test' INT NOT NULL AUTO_INCREMENT PRIMARY KEY |
This file contains hidden or 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
-- An easy way to find which mysql.sock is being used and the path of it, simply log in into your mysql and run this command: | |
SHOW VARIABLES LIKE '%sock%'; |
This file contains hidden or 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
# After getting into the system from a snapshot, use the following command to set the snapshot | |
snapper rollback |
OlderNewer