Skip to content

Instantly share code, notes, and snippets.

View kevyworks's full-sized avatar
Nope!

Kevs kevyworks

Nope!
View GitHub Profile
@kevyworks
kevyworks / Local Dev Environment.md
Last active May 2, 2020 18:23
macOS Mojave (Dev)

Install Guide

macOS Mojave 10.14 - kevyworks

Preparing Environment

1. Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@kevyworks
kevyworks / GoogleURLAPI.php
Created August 29, 2018 17:19
GoogleUrlApi Simple Class
<?php
/**
* Class GoogleUrlApi
*/
class GoogleURLAPI
{
/**
* GoogleUrlApi constructor.
* @param $key
@kevyworks
kevyworks / ApiMailer.php
Created August 17, 2018 15:00
Laravel ApiMailer [WIP]
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Egulias\EmailValidator\EmailValidator;
use Egulias\EmailValidator\Validation\EmailValidation;
use Egulias\EmailValidator\Validation\MultipleValidationWithAnd;
/**
@kevyworks
kevyworks / BladeComponentFactory.php
Last active August 29, 2018 18:21
A Laravel 5.3 Blade Component
<?php
namespace App\Libraries;
use Illuminate\Support\HtmlString;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\Factory;
/**
* Class BladeComponentsFactory
@kevyworks
kevyworks / CurlRequest.php
Last active June 25, 2018 00:03
Laravel Curl Request Library - Original code by: https://github.com/ixudra/curl/blob/master/src/Builder.php -- Added Cache
<?php
namespace App\Support;
use Exception;
use stdClass;
class CurlRequest
{
/** @var resource $curlObject cURL request */
@kevyworks
kevyworks / CriteriaInterface.php
Last active June 24, 2018 23:41
Laravel 5.6 - Repository
<?php
namespace App\Support\Repository\Contracts;
interface CriteriaInterface
{
/**
* The criteria to be applied must go inside this method.
*
* @param mixed $queryBuilder Current query builder.
@kevyworks
kevyworks / BasicAuth.php
Last active November 30, 2018 14:06
Custom Basic Auth
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
/**
* Class BasicAuth
@kevyworks
kevyworks / tunnel.sh
Created April 13, 2018 16:26
Tunnel Script
#!/bin/bash
# usage: tunnel <PORT>
PORT=${1:-8000}
# https://github.com/localtunnel/localtunnel
# Insure localtunnel is installed globally. npm install -g localtunnel
if ! [ -x "$(command -v lt)" ]; then
echo "Installing localtunnel..."
npm install -g localtunnel
@kevyworks
kevyworks / prep-ncv-env.sh
Last active April 14, 2022 15:54
Prepare Dev Machine for: Node Composer & Laravel Valet
# MOJAVE: https://gist.github.com/kevmt/476716bfb0383d3fda699e4fcacc6470
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Terminal Aliases
echo "alias artisan='php $PWD/artisan'" >> ~/.bash_profile
echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile
echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
@kevyworks
kevyworks / uptimemonitor.sh
Created September 8, 2017 10:33 — forked from sweetmandm/uptimemonitor.sh
Cron job to monitor websites and send an email if the website is down.
#! /bin/sh
# A script to monitor uptime of websites,
# and notify by email if a website is down.
SITES="ADD COMMA-SEPARATED WEBSITES HERE"
EMAILS="ADD COMMA-SEPARATED EMAILS HERE"
for SITE in $(echo $SITES | tr "," " "); do
if [ ! -z "${SITE}" ]; then
RESPONSE=$(curl -s --head $SITE)
if echo $RESPONSE | grep "200 OK" > /dev/null