Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Glued to the keyboard!

Ruben Robles d8vjork

⌨️
Glued to the keyboard!
View GitHub Profile
@d8vjork
d8vjork / php.json
Created December 19, 2022 11:36
My PHP 8+ snippets for VSCode as for now
View php.json
{
"Inline typed variable": {
"prefix": [
"var"
],
"body": [
"$BLOCK_COMMENT_START* @var ${1:mixed} $${2} $BLOCK_COMMENT_END",
"\\$${2} = ${3};"
]
},
@d8vjork
d8vjork / javascript.json
Last active September 9, 2021 15:50
Vue 3 + JS + TS (Composition API & Setup RFC only) VS Code snippets
View javascript.json
{
"setup defineProps": {
"prefix": "sprops",
"body": [
"${1:const props = }defineProps({",
"\t${2:${3:prop}: ${4:type},}",
"});"
],
"description": "Create setup defineProps block"
},
@d8vjork
d8vjork / AppServiceProvider.php
Last active August 25, 2021 11:20
Laravel Passport with Inertia as authorize's response
View AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
@d8vjork
d8vjork / .php-cs-fixer.php
Last active June 29, 2022 11:03
PHP-CS-Fixer config for its new released version 3, used in all my Laravel projects
View .php-cs-fixer.php
<?php
use PhpCsFixer\{Config, Finder};
$rules = [
// Rules taken from: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200#gistcomment-3860156
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'no_unused_imports' => true,
'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 August 23, 2019 14:07
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
Last active July 27, 2021 14:32
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 July 16, 2019 13:20
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 .'