Skip to content

Instantly share code, notes, and snippets.

View iradofurioso's full-sized avatar
🧠
Make it work, Make it right, Make it fast

Carlos Eduardo iradofurioso

🧠
Make it work, Make it right, Make it fast
View GitHub Profile
@iradofurioso
iradofurioso / txt
Created May 30, 2019 19:53
Use VI to remove BOM | Utilizando o VI para remover BOM (Byte-order-mark)
vim my-file.txt
# On VIM just type the following command to remove BOM
:set nobomb
# Saving the file
:wq!
@iradofurioso
iradofurioso / txt
Created June 13, 2019 14:06
PHP Artisan Tinker crashing all the time on MacOS Mojave
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:
@iradofurioso
iradofurioso / php
Created June 14, 2019 22:16
Laravel - Security - Hiding image (or any other file with correct mime) real path
return response($myImagePath, 200)->header('Content-Type', 'image/jpeg');
@iradofurioso
iradofurioso / php
Created June 15, 2019 23:49
Laravel: Removendo o prefixo '/api/' da URL | Removing /api/ prefix from URL
//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'));
@iradofurioso
iradofurioso / _ide_helper.php
Created June 16, 2019 01:25 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?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 <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@iradofurioso
iradofurioso / shell
Created June 16, 2019 13:07
Limpa todos os arquivos de cache no Laravel | Clear all Laravel cache files
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache
@iradofurioso
iradofurioso / sql
Created July 17, 2019 20:17
Find mysql.sock in use (the correct one)
-- 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%';
@iradofurioso
iradofurioso / bash
Created July 17, 2019 20:26
OpenSUSE LEAP 15 - Set an snapshot as default
# After getting into the system from a snapshot, use the following command to set the snapshot
snapper rollback
@iradofurioso
iradofurioso / bash
Created July 18, 2019 12:36
Como atualizar o VisualCode no OpenSUSE LEAP
# Primeira coisa a ser feita (caso não tenha feito ainda) é rodar os três comandos abaixo:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/zypp/repos.d/vscode.repo'
sudo zypper refresh
# Depois rodar o comando que vai atualizar o pacote
@iradofurioso
iradofurioso / txt
Created July 22, 2019 14:05
Get rid of webpack-dev-server status bar
To get rid of webpack-dev-server status bar when compiling Angular script there is an easy solution. No change in configuration is ncessary.
When running ng serve it will give the following link http://localhost:4200/webpack-dev-server/
Just remove the last part of it "webpack-dev-server/"
BANG! no status bar. Problem solved!