Skip to content

Instantly share code, notes, and snippets.

View wilmanbarrios's full-sized avatar

Wilman Barrios wilmanbarrios

View GitHub Profile
@wilmanbarrios
wilmanbarrios / Yii2ValetDriver.php
Created October 29, 2019 13:50 — forked from HavenShen/Yii2ValetDriver.php
Yii2 valet driver . `cp Yii2ValetDriver.php ~/.valet/Drivers/`
<?php
class Yii2ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@wilmanbarrios
wilmanbarrios / DateInput.vue
Created August 27, 2019 17:42 — forked from reinink/DateInput.vue
Pikaday Vue Component
<template>
<div>
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label>
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change">
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
<script>
import pikaday from 'pikaday'
@wilmanbarrios
wilmanbarrios / .php_cs.laravel.php
Created July 17, 2019 13:55 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@wilmanbarrios
wilmanbarrios / chain_helper.php
Created January 30, 2019 22:10 — forked from calebporzio/chain_helper.php
Handy "chain()" helper method for making non-fluent classes/objects fluent.
<?php
function chain($object)
{
return new class ($object) {
public function __construct($object)
{
$this->wrapped = $object;
}
@wilmanbarrios
wilmanbarrios / laravel-dependencies.md
Last active February 7, 2019 00:01
Instalación de PHP y Nodejs

Requisitos servidor con aplicaciones Laravel 5.*

PHP 7.1.*

Herramientas necesarias

sudo apt-get install -y git vim curl wget zip unzip

Extenciones comunes de php7.*

<snippet>
<content><![CDATA[
/** @test */
function ${1/\s/_/g}() {
${0:// ${1:type name of method with spaces}}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<?php
class Warp extends Space
{
protected $array;
public function __construct($array)
{
$this->array = $array;
}
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export PATH=/opt/firefox/firefox:$PATH
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {