Skip to content

Instantly share code, notes, and snippets.

View JuanVqz's full-sized avatar
🦖
Doing Ruby and JavaScript

Juan Vásquez JuanVqz

🦖
Doing Ruby and JavaScript
View GitHub Profile
@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">
@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 / 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 / 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 / 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 / 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 / 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 / config.js
Last active June 26, 2018 16:02
configuración de vuepress
module.exports = {
title: 'JuanVqz.github.io',
themeConfig: {
nav: [
{ text: 'Bienvenido', link: '/'}
],
sidebar: [
'/',
/*! debug.css | MIT License | zaydek.github.com/debug.css */
*:not(path):not(g) {
color: hsla(210, 100%, 100%, 0.9) !important;
background: hsla(210, 100%, 50%, 0.5) !important;
outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;
box-shadow: none !important;
}
@JuanVqz
JuanVqz / simple_form_bulma.rb
Last active December 24, 2023 17:52
Support for simple form with bulma css, copy and paste on config/initializers/simple_form_bulma.rb
# frozen_string_literal: true
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Default class for buttons
config.button_class = "button"
# Define the default class of the input wrapper of the boolean input.
config.boolean_label_class = "checkbox"