Skip to content

Instantly share code, notes, and snippets.

View JuanVqz's full-sized avatar
🦖
Sorting tech debt out

Juan Vásquez JuanVqz

🦖
Sorting tech debt out
View GitHub Profile
@JuanVqz
JuanVqz / functions.php
Last active May 6, 2018 21:45
functions utilities phpunit, factory make
<?php
// composer.json
// "autoload-dev": {
// ...
// "files": ["tests/utilities/functions.php"]
// ...
// }
function create($class, $attributes = [])
@JuanVqz
JuanVqz / TestCase.php
Last active May 6, 2018 21:42
TestCase.php with signIn method 2
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
@JuanVqz
JuanVqz / passport.md
Created May 5, 2018 04:18
Passport configuration

Install passport step by step

  1. Install passport
composer require laravel/passport
  1. Run migrations
@JuanVqz
JuanVqz / vim-blade-snippets
Created October 1, 2017 14:57
vim-blade-snippets
extends html
snippet foreach "@foreach"
@foreach ($${1:array} as $${2:item})
{{ $$2->${3} }}
@endforeach
snippet if "@if"
@if (${1:true})
${2:tag}
@JuanVqz
JuanVqz / folding vim
Last active September 28, 2017 05:02
folding vim
" Folding, not need for plugin
"" fold enable
set fen
"" no fold enable
set nofen
"" fold column
set fdc=0
@JuanVqz
JuanVqz / Vue Spinner Component
Created September 8, 2017 02:10
Icon that rotates while loading the page
<!-- Call from template -->
<spinner :loading="loading"></spinner>
<!-- Component -->
<template>
<div id="spinner">
<div class="form-group text-center" v-if="loading">
<i class="fa fa-2x fa-cog fa-spin"></i>
</div>
</div>
@JuanVqz
JuanVqz / vue pagination
Created September 8, 2017 02:05
vue pagination component with events
<pagination :pag="pagination"
@prev="getUsers(...arguments)"
@next="getUsers(...arguments)">
</pagination>
<template>
<div id="pagination" class="row justify-content-md-center">
<nav aria-label="Page navigation">
<ul class="pagination pagination" v-if="this.pag.count > 0">
<li class="page-item" v-if="this.pag.current_page > 1">