Skip to content

Instantly share code, notes, and snippets.

View u01jmg3's full-sized avatar
🔷
Coding Hard

Jonathan Goode u01jmg3

🔷
Coding Hard
View GitHub Profile
@u01jmg3
u01jmg3 / material-design-circle.html
Last active August 29, 2015 14:03
Recreating the Animated Circle Effect as Seen on Google Design
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Recreating the Animated Circle Effect as Seen on Google Design</title>
<style>
.col {
position: relative;
display: block;
float: left;
@u01jmg3
u01jmg3 / menu.html
Last active August 29, 2015 14:03
Menu Toggle Rotate on Open Animation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Menu</title>
<style>
ul.drawer { width:300px; background: #5f626a; display:none; }
ul.drawer li { padding:20px 30px; color: #bbb; border-bottom:1px solid #4a4f5b; font-family: arial; }
ul.drawer li:hover { background: #6b6e75; cursor:pointer; }
@u01jmg3
u01jmg3 / index.html
Last active August 29, 2015 14:04
Notifications Example using Web Notifications API (run from WAMP)
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Description" content="">
<meta name="Keywords" content="">
<meta name="Author" content="Jonathan Goode">
<meta name="copyright" content="&copy; Jonathan Goode, 2015">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Notifications</title>
/* Pre-Define HTML5 Elements in IE */
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )();
@u01jmg3
u01jmg3 / label-generation.cmd
Last active May 23, 2016 12:51
Creating custom additional labels ('change', 'update') for a new repo using the GitHub API and cURL
:: http://www.confusedbycode.com/curl/ > curl-7.39.0-win64.zip
:: https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
@echo off
SETLOCAL
echo This script creates issue labels for a GitHub repository
echo.
echo Please specify the GitHub Profile containing the Repository, e.g.:
echo https://github.com/:org|:owner/:repo
echo ~~~ ~~~~~
set /P username= " Enter GitHub Username: "
@u01jmg3
u01jmg3 / how-to-setup-phpcs-phpcbf-and-phpmd.md
Last active December 20, 2020 16:44
PHP Codesniffer, Code Beautifier & Mess Detector Setup

Composer Installation

  • Install Composer - https://getcomposer.org/Composer-Setup.exe
    • ℹ️ You may need to enable OpenSSL in your PHP installation by going directly to ./wamp/bin/php/php-5.x.x/php.ini and enabling the OpenSSL extension
      • These instructions assume you have WAMP installed already in order to provide your technology stack
    • To install globally the necessary Composer packages paste this command into a terminal and hit Enter ↵
      • ℹ️ The openssl extension must be enabled within php.ini of the PHP build you are using with the command line
      • (Start → Run → Type: cmd to open a command prompt)
    • Add C:\Users\%USERNAME%\AppData\Roaming\Composer\vendor\bin to the PATH System Variable
  • Start → Run → control sysdm.cpl,,3 → Environment Variables
@u01jmg3
u01jmg3 / validate.php
Last active August 29, 2015 14:13
Function to validate letters (incl. special chars) and numbers and to check the min/max size
<?php
/*
Allowed characters:
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
\x{00C0}-\x{00CF}\x{00D0}-\x{00D6}\x{00D8}-\x{00DF}\x{00E0}-\x{00EF}\x{00F0}-\x{00F6}\x{00F8}-\x{00FF}
[space] \n - , . / ! % & ' ( ) : ; ? @ _ £
\ \n\-\x{002C}\x{002E}\x{002F}\x{0021}\x{0025}-\x{0029}\x{003A}\x{003B}\x{003F}\x{0040}\x{005F}\x{00A3}
*/
@u01jmg3
u01jmg3 / delay.js
Last active August 29, 2015 14:15
Delays when a function runs. Perfect for using with a search box and waiting for a user to finish typing a term before executing a filter script.
/**
* Delays when a function runs.
*
* @return callback
*/
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout(timer);
timer = setTimeout(callback, ms);
@u01jmg3
u01jmg3 / is-blank.php
Last active August 29, 2015 14:15
Quick function to check if a value is blank including returning `0` as not blank.
/**
* @param Mixed
* @return Boolean
*/
function is_blank($value){
return empty($value) && !is_numeric($value);
}
//is_blank(0); //false
//is_blank(''); //true
@u01jmg3
u01jmg3 / gulpfile.js
Last active December 24, 2017 02:54
Convert all PHP/HTML files within a specified folder (and its subfolders) to use 4 spaces over tabs and `\n` for all line endings - *LOCAL*
'use strict';
var gulp = require('gulp');
var soften = require('gulp-soften'),
argv = require('yargs').argv,
eol = require('gulp-eol'),
trimlines = require('gulp-trimlines'),
pathExists = require('path-exists'),
gulpIgnore = require('gulp-ignore')