Skip to content

Instantly share code, notes, and snippets.

View shakyShane's full-sized avatar

Shane Osbourne shakyShane

View GitHub Profile
@shakyShane
shakyShane / find_your_nearest.php
Created September 9, 2012 19:56
HTML to Json
<?php
/**
*
* ----------------------------------------------
* HTML to JSON
* ----------------------------------------------
*
* [Currently used in Wordpress to output HTML into a Google Maps InfoWindow correctly]
*
@shakyShane
shakyShane / findYourNearest.js
Created September 9, 2012 20:48
Test for a UK Postcode - Javascript
/**
* ----------------------------------------------
* isValidPostcode() Function
* ----------------------------------------------
*
* Tests to see if string is in correct UK style postcode: AL1 1AB, BM1 5YZ etc.
*
* @param p
* @return {Boolean}
*/
@shakyShane
shakyShane / index.html
Created September 14, 2012 21:31
Slide & fade in Elements with CSS3 transitions
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<style type="text/css">
.container {
overflow: hidden;
@shakyShane
shakyShane / HTML Boilerplate
Created November 7, 2012 19:13
Boilerplate for HTML test pages
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body>
@shakyShane
shakyShane / html5-number-polyfill.html
Created November 7, 2012 19:23
Increment/Decrement an 'amount' input.
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body>
@shakyShane
shakyShane / Gallery.php
Last active November 8, 2017 15:35
Create a simpe PHP Photo Gallery with Pagination
@shakyShane
shakyShane / CustomHelpers.php
Created November 23, 2012 20:03
Custom View Helpers - Laravel
<?php
class CustomHelpers
{
/**
*
* ----------------------------------------------
* Create a Title from a route
* ----------------------------------------------
@shakyShane
shakyShane / getDirectChildren.js
Created December 9, 2012 11:26
Get Direct Children Javascript
function getDirectChildren(elm, sel){
ret = [];
for (var i =0; i < elm.childNodes.length; ++i){
if (elm.childNodes[i].matchesSelector(sel)){
ret.push(elm.childNodes[i]);
}
}
return ret;
}
@shakyShane
shakyShane / fullpage-gallery.html
Created December 18, 2012 20:25
get viewport width/height
@shakyShane
shakyShane / Toggle.js
Created April 18, 2013 00:20
Toggler
var Toggle = (function() {
function Toggle( config ) {
this.config = config;
this.triggers = $( config.triggers );
this.closeElem = $( config.close );
this.closeAnyElem = $( config.closeAny );
this.activeClass = config.activeClass;
this.shouldFollow = true;
this.attachEvents();