Skip to content

Instantly share code, notes, and snippets.

View labithiotis's full-sized avatar
🏠
Working from home

Darren Labithiotis labithiotis

🏠
Working from home
View GitHub Profile
@labithiotis
labithiotis / Locale tempting spec
Last active August 29, 2015 14:28
Specification for locale tempting
LOCALE SPEC
Parse string and inject appropriate variables,
process through each {{ }},
determine each type and return variable.
Types and Options have long and short distinguishes.
TYPES:
gender (g) | Male or Female
@labithiotis
labithiotis / gist:10470514
Last active August 29, 2015 13:59
Change Url Params JS
/** ==================== GET URL PARAMS AS OBJECT ==================== **/
urlGetParams = function(sParams){
var sHash = sParams|| window.location.hash,
result = {};
sHash.substring(sHash.indexOf('?') + 1).split('&').forEach(function(el) {
var kv = el.split('=');
result[kv[0]] = decodeURIComponent(kv[1]);
});
@labithiotis
labithiotis / gist:9483717
Last active August 29, 2015 13:57
Set custom HTML5 validation messages on elements and reset after user input
/** ============ SET HTML5 VALIDATION MESSAGE ============
document.getElementById('element').setValidationMessage('Oops.. that\'s not right');
=========================================================== **/
(function(window, Element){
"use strict";
Element.prototype.setValidationMessage = function(msg) {