Skip to content

Instantly share code, notes, and snippets.

View lukzgois's full-sized avatar

Lucas Gois lukzgois

View GitHub Profile
@lukzgois
lukzgois / hourmanager1.md
Last active November 18, 2020 22:20
Instalação do Homestead para o projeto HourManager

Laravel Iniciante - Hour Manager - Parte 1

Olá galera, tudo tranquilo?!?!?

Este é o início de uma série de posts para a construção de um aplicativo de gerencimento de horas utilizando Laravel 5.
Na construção desse aplicativo utilizaremos o básico do Laravel e será um tutorial para iniciantes. Vamos entender o conceito de rotas, controllers, sobre a camada de bando de dados do Laravel, o tão falado eloquent.

Sobre o aplicativo

@lukzgois
lukzgois / SimpleTransformer.php
Created May 12, 2016 14:30
Simple transformer for Laravel
<?php
namespace App\Domain\Transformer;
use Illuminate\Contracts\Pagination\LengthAwarePaginator as PaginatorContract;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Collection;
use MongoDB\Model\BSONArray;
@lukzgois
lukzgois / post.md
Last active August 18, 2016 19:04
Minha IDE, Minha vida

Salve salve galera, tudo bem? Então, para começar com o blog resolvi falar um pouco sobre algo que acompanha os programadores diariamente: IDE de desenvolvimento.

Pois bem, já utilizei várias: netbeans, aptana, komodo, vim, phpstorm e atualmente migrei para o sublime. Gostava bastante do PHPStorm, porém o que me chateava muito nele era o consumo de memória e a lentidão certos momentos para tarefas simples. Resolvi então dar uma chance ao sublime, e desde então estou com ele. Resolvi então fazer um post para compartilhar minha configuração do sublime e também os plugins que estou utilizando para auxiliar no desenvolvimento com PHP e Laravel.

Nota: estou utilizando o sublime-text 3 Nota 2: grande parte da minha configuração foi baseada em um arquivo do Matt Staufer([@stauffermatt][1]) que pode ser visto nesse link: https://mattstauffer.co/blog/sublime-text-3-for-php-developers

Package Control

O primeiro plugin que se deve instalar no sublime 3 é o package control. Ele nos permite instalar facilment

@lukzgois
lukzgois / .gitalias
Last active July 28, 2016 20:57
Some git alias for my projects
[alias]
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = !git rev-parse --abbrev-ref HEAD
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = !git push -u origin $(git branch-name)
force-publish = !git push -u -f origin $(git branch-name)
@lukzgois
lukzgois / ajax-csrf-token.js
Last active March 16, 2016 01:07
Laravel CSRF Token Ajax
$.ajaxSetup(
{
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
//meta tag
document.querySelector('meta[name="csrf-token"]').getAttribute('content');
@lukzgois
lukzgois / Envoy.blade.php
Created June 5, 2015 19:27
Basic envoy file for easy deployment
@servers(['localhost' => 'localhost'])
<?php
$repo = '';
$base_dir = '/var/www/myapp';
$release_dir = "$base_dir/releases";
$app_dir = "$base_dir/current";
$log_dir = "$base_dir/logs";
$release = 'release_' . date('YmdHis');
$branch = 'master';
@lukzgois
lukzgois / .vimrc
Created February 24, 2016 21:02
My Vim Config
set nocompatible " be iMproved, required
so ~/.vim/plugins.vim "Load vundle plugins
syntax enable
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "Make comma the leader key.
@lukzgois
lukzgois / KeyBindings
Last active February 24, 2016 20:59
Sublime Config Files
[
{ "keys": ["f6"], "command": "expand_fqcn" },
{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
{ "keys": ["f5"], "command": "find_use" },
{ "keys": ["f4"], "command": "import_namespace" },
{ "keys": ["shift+f12"], "command": "goto_definition_scope" },
{ "keys": ["j", "j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
@lukzgois
lukzgois / settings.json
Last active February 24, 2016 20:57
Sublime Text 3 Config
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"draw_minimap_border": true,
"font_face": "Fira Code",
"font_options":
[
"gray_antialias"
],
@lukzgois
lukzgois / blade_breadcrumbs.php
Created December 16, 2015 12:56
Lavarel blade breadcrumbs
Blade::directive('breadcrumbs', function ($expression = null) {
return "
<ol class=\"breadcrumb\">
<li><a href=\"/\">Home</a></li>
<?php if(isset(\$expression)): ?>
<?php foreach(with($expression) as \$text => \$link): ?>
<?php if(!is_int(\$text)): ?>
<li>
<a href=\"<?php echo \$link ?>\">
<?php echo \$text ?>