Skip to content

Instantly share code, notes, and snippets.

Avatar
💼
Back into the "bisnes"

Ruben Robles d8vjork

💼
Back into the "bisnes"
View GitHub Profile
@d8vjork
d8vjork / .php-cs-fixer.php
Last active May 12, 2021
PHP-CS-Fixer config for its new released version 3, used in all my Laravel projects
View .php-cs-fixer.php
<?php
$rules = [
'group_import' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
],
'blank_line_after_namespace' => true,
View .gitlab.yml
stages:
- build
- deploy
yarn_install:
stage: build
cache:
key: "${CI_PROJECT_ID}_yarn"
policy: pull-push
paths:
@d8vjork
d8vjork / Handler.php
Created Aug 23, 2019
Put this in your Laravel's Handler.php to format all the exceptions to JSON:API format
View Handler.php
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
@d8vjork
d8vjork / php.json
Created Aug 19, 2019
My VS Code snippets setup (WIP)
View php.json
{
"Object property": {
"prefix": "property",
"body": [
"$BLOCK_COMMENT_START*",
" * @var ${1:mixed}",
" $BLOCK_COMMENT_END",
"${2:protected} $${3:name};"
]
}
View sublime-preferences.json
{
"editor_path": "/usr/local/bin/code",
"editor_argument_format": "--goto ${file}:${line}:${col}"
}
@d8vjork
d8vjork / .bash_aliases
Created Jul 16, 2019
My OhMyZsh OS X setup
View .bash_aliases
alias gitclean='git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d && git remote prune origin'
alias dockerclean='docker stop $(docker ps -aq) && docker rm $(docker ps -a -q) -f'
alias dockerwash='docker rmi $(docker images -q)'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerkill='docker kill $(docker ps -q)'
alias dockerprune='docker system prune --all --force --volumes'
alias dockerreset='docker stop $(docker container ls -a -q) && docker system prune -a -f --volumes'
alias gs='git status'
alias gl='git log'
alias gaa='git add .'
View Makefile
...
help: ## Print the help page
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) |\
cut -d ':' -f 2,3 |\
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
up: ## Start Docker services
@docker-compose up -d
@d8vjork
d8vjork / gist:4c713381a0648a92890d0882e76a0d65
Created Mar 20, 2019
MySQL Workbench dark theme temporary fix (Mojave)
View gist:4c713381a0648a92890d0882e76a0d65
defaults write com.oracle.workbench.MySQLWorkbench NSRequiresAquaSystemAppearance -bool yes
@d8vjork
d8vjork / README.md
Last active Mar 10, 2019
My SublimeText 3 build (just PHP development)
View README.md

Extensions

  • A File Icon
  • Agila Theme
  • ApacheConf
  • AutoFileName
  • BracketHighlighter
  • DocBlockr
  • EditorConfig
  • Emmet
@d8vjork
d8vjork / form.blade.php
Created Mar 1, 2019
One line validation include element, useful for inline validation messages (Laravel 5.4+)
View form.blade.php
@includeWhen($errors->has('email'), 'shared.validation', ['message' => $errors->first('email')])