Skip to content

Instantly share code, notes, and snippets.

View d8vjork's full-sized avatar
💰
Focused on commercial projects

Ruben Robles d8vjork

💰
Focused on commercial projects
View GitHub Profile
@d8vjork
d8vjork / php.json
Created December 19, 2022 11:36
My PHP 8+ snippets for VSCode as for now
{
"Inline typed variable": {
"prefix": [
"var"
],
"body": [
"$BLOCK_COMMENT_START* @var ${1:mixed} $${2} $BLOCK_COMMENT_END",
"\\$${2} = ${3};"
]
},
@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
<?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,
{
"editor_path": "/usr/local/bin/code",
"editor_argument_format": "--goto ${file}:${line}:${col}"
}
@d8vjork
d8vjork / javascript.json
Last active September 9, 2021 15:50
Vue 3 + JS + TS (Composition API & Setup RFC only) VS Code snippets
{
"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
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
@d8vjork
d8vjork / php.json
Last active July 27, 2021 14:32
My VS Code snippets setup (WIP)
{
"Object property": {
"prefix": "property",
"body": [
"$BLOCK_COMMENT_START*",
" * @var ${1:mixed}",
" $BLOCK_COMMENT_END",
"${2:protected} $${3:name};"
]
},
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
<?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 / Makefile
Last active February 3, 2020 00:37
...
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