Skip to content

Instantly share code, notes, and snippets.

View kevyworks's full-sized avatar

Kevyworks kevyworks

View GitHub Profile
@kevyworks
kevyworks / currency-symbols.xml
Created October 1, 2015 02:38 — forked from bzerangue/currency-symbols.xml
World currencies with their symbols
<?xml version="1.0" encoding="UTF-8"?>
<!--
## SOURCE: xe.com
-->
<currency-symbol count="115">
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry>
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry>
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry>
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry>
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry>
@kevyworks
kevyworks / DotNotation.php
Created February 2, 2016 07:03 — forked from antonmedv/DotNotation.php
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*

Guide installing LAMP & php7.0 (BashOnWindows)

I will assume that you have already installed BashOnWindows. Note: Some AntiVirus prohibits successfull installation, like Avast. Uninstall Avast.

Installing LAMP-SERVER

  • Run bash.exe in Administrator Mode
  • # apt-get install lamp-server^
@kevyworks
kevyworks / scotchboxphp7.txt
Created November 15, 2016 15:16 — forked from mizner/scotchboxphp7.txt
Scotchbox PHP 7
List of PHP 7 Packages: https://launchpad.net/ubuntu/+source/php7.0
Disclaimer: I get unreliable results when I don't run these commands seperately and in order.
vagrant ssh
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get update
@kevyworks
kevyworks / jquery.pjax.js
Created July 10, 2017 05:46 — forked from oh-ren/jquery.pjax.js
pjax hacked, so it works with jQuery 3.0
/*!
* Copyright 2012, Chris Wanstrath
* Released under the MIT License
* https://github.com/defunkt/jquery-pjax
*/
(function($){
// When called on a container with a selector, fetches the href with
// ajax into the container or with the data-pjax attribute on the link
@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
@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 / 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 / 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 / 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.