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 ACF & JSON-API | |
add_filter('json_api_encode', 'json_api_encode_acf'); | |
function json_api_encode_acf($response) | |
{ | |
if (isset($response['posts'])) { | |
foreach ($response['posts'] as $post) { | |
json_api_add_acf($post); // Add specs to each post | |
} | |
} |
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
document.addEventListener('keyup', function (e) { | |
var keyCode = e.keyCode || e.which, | |
arrow = { left: 37, up: 38, right: 39, down: 40 }; | |
switch (keyCode) { | |
case arrow.left: | |
console.log(keyCode); | |
break; | |
case arrow.up: |
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 http://modernizr.com/download/#-addtest-json-script_defer-load */ | |
(function(window, document, Modernizr, undefined) { | |
'use strict'; | |
Modernizr.addTest('jQueryVersion', function() { | |
return ( | |
Modernizr.json && | |
Modernizr.scriptdefer && |
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 video = function() { | |
if( $('#video').length > 0 ){ | |
videojs("video", {}, function(){ | |
playvideo(this); | |
}); |
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
// extend prototype to check email address on string | |
String.prototype.checkEmail = function(){ | |
var e=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | |
return e.test(this); | |
}; | |
// usage | |
// "[email protected]".checkEmail(); (returns true/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
<select> | |
<option value="00:00">00:00</option> | |
<option value="00:15">00:15</option> | |
<option value="00:30">00:30</option> | |
<option value="00:45">00:45</option> | |
<option value="01:00">01:00</option> | |
<option value="01:15">01:15</option> | |
<option value="01:30">01:30</option> | |
<option value="01:45">01:45</option> | |
<option value="02:00">02:00</option> |
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
calendarTo.on('mouseover', 'td', function(){ | |
var tds = calendarTo.find('td').not('.ui-datepicker-other-month'); | |
fromTd = tds.filter('.ui-state-range:first'); | |
thisTd = $(this); | |
startIndex = tds.index(fromTd); |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb", | |
".svn" | |
], |
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
// i know, i know, browser sniffing :( | |
// adaptation of http://stackoverflow.com/questions/8348139/detect-ios-version-less-than-5-with-javascript | |
Modernizr.addTest('ios6', function() { | |
var ios6 = false, | |
v, ver = false; | |
if (/iP(hone|od|ad)/.test(navigator.platform)) { | |
v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/), | |
ver = parseInt(v[1], 10); |
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 | |
/* | |
* https://github.com/filamentgroup/grunticon | |
* https://www.npmjs.org/package/grunt-text-replace | |
*/ | |
'use strict'; | |
module.exports = function (grunt) { |