Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Daniel Griffiths Daniel-Griffiths

🏠
Working from home
View GitHub Profile
@Daniel-Griffiths
Daniel-Griffiths / Router
Created Jun 19, 2017
Random small router
View Router
<?php
class Router
{
/**
* Route storage.
*
* @var array
*/
protected $routes = [];
@Daniel-Griffiths
Daniel-Griffiths / Icon.php
Last active Aug 24, 2016
PHP Svg Helper Class
View Icon.php
<?php
namespace Icon;
/**
* Simple helper class that outputs
* svg icons as text
*/
class Icon
{
@Daniel-Griffiths
Daniel-Griffiths / OpenWithSublimeText.bat
Created Jun 17, 2016
adds a right click context menu for sublime in windows
View OpenWithSublimeText.bat
@echo off
SET st3fqfn=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3fqfn%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3fqfn% \"%%1\"" /f
rem add it for directories
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
View validate.js
/*
* Plugin: Validate v0.1
* Author: Daniel Griffiths
*/
(function($) {
$.fn.validate = function(){
this.each(function(){
var form = this;
View broadband speed
<?php
/*
|--------------------------------------------------------------------------
| Broadband Speed Class
|--------------------------------------------------------------------------
|
| This class allows you to parse a CSV file and return the average UK
| broadband speed.
|
| https://data.gov.uk/dataset/broadband-coverage