Skip to content

Instantly share code, notes, and snippets.

View eaguad1337's full-sized avatar
🚀

Eduardo Aguad eaguad1337

🚀
View GitHub Profile
@eaguad1337
eaguad1337 / LaraHelperController.php
Last active April 12, 2017 13:41
JS script to resolve laravel routes
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Route;
class LaraHelperController extends Controller
{
public function getRoutes() {
@eaguad1337
eaguad1337 / VeeRutValidator.js
Created October 16, 2017 20:43
Chilean Rut Validator for VeeValidate
// Eduardo Aguad [email protected]
// Use:
// yarn add vee-validate
// import VeeValidate, {Validator} from 'vee-validate';
// Validator.extend('rut', require('./VeeRutValidator'));
// <input type="text" name="rut" v-validate="rut">
module.exports = {
@eaguad1337
eaguad1337 / VueValetDriver.php
Created December 26, 2017 18:10
Valet Driver for Vue SPA application. Place it in your root directory.
<?php
class VueValetDriver extends ValetDriver
{
static $publicPath = 'public';
static $startFile = 'public/index.html';
/**
* Determine if the driver serves the request.
*
@eaguad1337
eaguad1337 / RegionsCommuneSeeder.php
Created January 2, 2018 20:49
Laravel seeder for Chilean Regions and Communes // Laravel seeder de Regiones y Comunas Chilenas
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Schema;
class RegionCommuneSeeder extends Seeder
{
/**
* Run the database seeds.
@eaguad1337
eaguad1337 / VeeRutValidator.js
Created January 3, 2018 15:47
VeeValidate Chilean Rut // VeeValidate Validador Rut Chileno
/*
* import VeeValidate, { Validator } from 'vee-validate';
* Validator.extend('rut', require('./VeeRutValidator'));
* Vue.use(VeeValidate);
*/
module.exports = {
getMessage: (field, params, data) => `El campo ${field} no es un rut válido`,
validate: rut => {
if (typeof(rut) !== 'string') {
@eaguad1337
eaguad1337 / beanstalk-purge.sh
Created February 16, 2018 13:44
Beanstalk Purge - Delete jobs from beanstalk
#!/usr/bin/expect -f
# Filename: beanstalk-purge
# Usage: ./beanstalk-purge $HOST $PORT $QUEUE $HOW_MANY
# Example: ./beanstalk-purge 127.0.0.1 11300 default 3000
set timeout 1
spawn telnet [lindex $argv 0] [lindex $argv 1]
sleep 1
send "use [lindex $argv 2]\n"
expect "USING"
@eaguad1337
eaguad1337 / ufw_whitelist_cloudflare.sh
Created October 22, 2018 14:11
UFW Whitelist Cloudflare
#!/bin/sh
# @author Eduardo Aguad <[email protected]>
cd /tmp
wget https://www.cloudflare.com/ips-v4 -O ips-v4-$$.tmp
wget https://www.cloudflare.com/ips-v6 -O ips-v6-$$.tmp
for cfip in `cat ips-v6-$$.tmp`; do ufw allow from $cfip to any port 443 proto tcp; done
for cfip in `cat ips-v4-$$.tmp`; do ufw allow from $cfip to any port 443 proto tcp; done
@eaguad1337
eaguad1337 / ufw_whitelist_forge.sh
Last active June 23, 2022 15:12
UFW Whitelist Laravel Forge
#!/bin/sh
# @author Eduardo Aguad <[email protected]>
curl -L https://forge.laravel.com/ips-v4.txt | xargs -n 1 -I {} ufw allow from {} to any port 22 proto tcp;
@eaguad1337
eaguad1337 / eligeeducar
Created November 23, 2018 18:06
eligeeducar
<a href="http://www.unnuevofuturo.cl/" target="_blank" style="
margin: 20px;
box-sizing: border-box;
background-color: #f0f0f0;
background-image: url(http://www.eligeeducar.cl/wp-content/uploads/2018/11/cover.png);
background-size: contain;
background-position: center;
display: block;
background-repeat: no-repeat;
"><img src="http://www.eligeeducar.cl/wp-content/uploads/2018/11/cover.png" style=""></a>
@eaguad1337
eaguad1337 / sphp.sh
Last active August 6, 2020 13:08 — forked from rhukster/sphp.sh
Switch PHP in OS X with this Bash Script
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
# Modified: Eduardo Aguad
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3")
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
valet_support_php_version_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
php_installed_array=()