This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var div = $('<div/>'); | |
function encodeEntities(str) { | |
return div.text(str).html(); | |
} | |
function decodeEntities(str) { | |
return div.html(str).text(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Modernizr.touch) { | |
var hero = $('#hero'); | |
var touchCancel = function() | |
{ | |
hero[0].removeEventListener('touchmove', touchMove, false); | |
hero[0].data('touch', false); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Diagonal Stripe Background with CSS and SVG | |
*/ | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
#content { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* requires jQuery | |
* usage: | |
* Scroller.to({ offset: 100 }); | |
* Scroller.to({ target: $('#main') }); | |
* | |
* advanced usage (with additional easing function not provided here) | |
* Scroller.to({ target: $('#main'), delay: 500, multiplier: 1.5, easing: 'easeOutQuad' }); | |
*/ | |
var Scroller = (function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add to functions.php in your WordPress theme | |
add_filter('upload_mimes', 'my_upload_mimes'); | |
function my_upload_mimes($mimes = array()) | |
{ | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input[type="date"]').each(function() | |
{ | |
var picker = new Pikaday({ field: this }); | |
$(this).data('pikaday', picker); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* | |
* Copyright (c) David Bushell | @dbushell | http://dbushell.com/ | |
* | |
*/ | |
var fs = require("fs"), | |
path = require("path"); | |
module.exports = function(grunt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* | |
* Copyright (c) David Bushell | @dbushell | http://dbushell.com/ | |
* | |
*/ | |
var fs = require("fs"), | |
path = require("path"); | |
module.exports = function(grunt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jasonwyatt.tumblr.com/post/10481498815/how-to-correctly-debounce-a-javascript-function | |
function debounce(fn, debounceDuration) | |
{ | |
debounceDuration = debounceDuration || 100; | |
return function(){ | |
if(!fn.debouncing){ | |
var args = Array.prototype.slice.apply(arguments); | |
fn.lastReturnVal = fn.apply(window, args); | |
fn.debouncing = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('ninja_forms_display_js', 'dbushell__ninja_forms_display_js'); | |
add_action('ninja_forms_display_css', 'dbushell__ninja_forms_display_css'); | |
function dbushell__ninja_forms_display_js() | |
{ | |
if (is_admin()) { | |
return; | |
} |
OlderNewer