Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Vagner Luz do Carmo vluzrmos

🏠
Working from home
View GitHub Profile
@vluzrmos
vluzrmos / lumen-HasIntendedRoute.php
Last active Aug 29, 2015
Lumen get intended route.
View lumen-HasIntendedRoute.php
<?php
// namespace Your\Awesome\Namespace\Here;
use Illuminate\Http\Request;
/**
* Trait HasIntendedRoute.
*/
trait HasIntendedRoute
@vluzrmos
vluzrmos / import_tgz.sh
Last active Aug 29, 2015
Function to import tgz file to mysql.
View import_tgz.sh
import_tgz(){
tar -xOzf $1 | mysql -u ${2:-root} -p${3:-1234}
}
@vluzrmos
vluzrmos / ibdm-sublime-text.settings.json
Last active Sep 11, 2015
My Sublime text settings with Material Theme.
View ibdm-sublime-text.settings.json
{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"color_scheme": "Packages/User/SublimeLinter/darkula (SL).tmTheme",
"enable_tab_scrolling": false,
"font_size": 13,
"folder_exclude_patterns": [".svn", ".idea", ".hg", "CVS"],
"ignored_packages":
[
"Vintage"
@vluzrmos
vluzrmos / phpfmt-settings-user.json
Last active Sep 11, 2015
Sublime Text: Preferences > Packages Settings > PHP Code Sniffer > Settings User
View phpfmt-settings-user.json
{
"php_cs_fixer_on_save": true,
"php_cs_fixer_additional_args": {
"--level": "psr2",
"--fixers": "-psr0"
}
}
@vluzrmos
vluzrmos / gist:da516cde6f303dc343fe
Created Nov 4, 2015 — forked from devster/gist:9545326
Install mscorefonts on debian wheezy
View gist:da516cde6f303dc343fe
# Add this repo to the /etc/apt/source.list file
deb ftp://ftp.debian.org/debian stable contrib non-free
# And run these commands
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
@vluzrmos
vluzrmos / add.sh
Created Feb 20, 2016
Configurar o SSL CERT para o CURL em todos os apps
View add.sh
# Adicione a seguinte variável ao seu sistema:
SSL_CERT_FILE=/path/to/curl-ca-bundle.crt
# Você pode pegar uma cópia desse certificado no diretório bin do GIT
@vluzrmos
vluzrmos / HasRandomStatementTrait.php
Last active May 12, 2016
Laravel Eloquent Agnostic Random Statement
View HasRandomStatementTrait.php
<?php
trait HasRandomStatementTrait
{
/**
* Random Statements by driver name.
* @var array
*/
protected $randomStatements = [
'mysql' => 'RAND()',
@vluzrmos
vluzrmos / command.bat
Last active Aug 29, 2016
[en] How to create command to .phar on windows | [pt_BR] Como criar comando de arquivo .phar no windows
View command.bat
@echo Off
php "%~dp0NOMEDOCOMANDO.phar" %*
#REM [en]
#REM %~dp0 is the directory of the actual file (command.bat) , its like the directive __DIR__ on php.
#REM [pt_BR]
#REM %~dp0 é o diretório do arquivo atual, similar a diretiva __DIR__ do php.
@vluzrmos
vluzrmos / .php_cs.php
Created Jul 8, 2015
phpcs-fixer configuration file to Laravel style. Note: rename this to .php_cs and put on root of your project or package.
View .php_cs.php
<?php
$finder = Symfony\Component\Finder\Finder::create()
->files()
->in(__DIR__)
->exclude('vendor')
->notName("*.txt")
->ignoreDotFiles(true)
->ignoreVCS(true);
@vluzrmos
vluzrmos / ValidatorServiceProvider.php
Last active Jan 3, 2017
Laravel - Simple file extension validator
View ValidatorServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\HttpFoundation\File\UploadedFile;
class ValidatorServiceProvider extends ServiceProvider
{