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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^(.+\.(?:jpg|jpeg|gif|png))$ /throttle.php?$1 [L] | |
</IfModule> |
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
/** | |
* Usage: | |
* loadScript('//exmp.com/script.js') | |
* loadScript('//exmp.com/script-another.js', function(){runCallback()}, {'data-attribute': 'has'}) | |
* Will not be loaded, because loaded earlier: | |
* loadScript('//exmp.com/script.js') | |
**/ | |
/** @type {loadScript} */ | |
var loadScript = (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
var site_url = window.site_url, | |
site_path = window.site_path | |
var escapeRegExp = function escapeRegExp(str) { | |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
} | |
/** | |
* @param {boolean} [leftTrim] | |
* @param {boolean} [rightTrim] |
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 | |
/** | |
* Detect ajax request | |
*/ | |
add_filter('parse_request', function ($query_vars) | |
{ | |
if (is_admin()) | |
{ | |
return $query_vars; | |
} |
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
/** | |
* jQuery.reduce - a jQuery plugin for functional programming | |
* @author Alex Batalov, John Hunter | |
* use: $('.elements').reduce(function(memo){return memo + $(this).height()}, 0); | |
* fnReduce is called with arguments: [valueInitial, value, i, arr] | |
* | |
* created 2010-09-17 | |
* modiffied 2013-12-09 | |
*/ |
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
$.resolved = function () { | |
var defers = arguments, | |
defersResolvedData = [], | |
alwaysCount = 0 | |
var resolvedDeferWrapper = $.Deferred() | |
var always = function checkQueue() { | |
if (++alwaysCount === defers.length) { | |
resolvedDeferWrapper.resolveWith($, defersResolvedData) |
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://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
!window.requestAnimationFrame && (window.requestAnimationFrame = null) | |
!window.cancelAnimationFrame && (window.cancelAnimationFrame = null) |
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 gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var path = require('path');// | |
var fs = require('fs'); | |
var ensureDirectory = function (filepath) { | |
var dir = path.dirname(filepath), | |
cmd, | |
existsSync = fs.existsSync || path.existsSync; | |
if (!existsSync(dir)) { |
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 ReadyChecker = (function () { | |
/** | |
* Simple Deferred | |
* @param {Function} readyCheckerResolver | |
* @param {Function} [callback] | |
* @constructor | |
*/ | |
function ReadyChecker (readyCheckerResolver, callback) { | |
this.onReady(callback) |
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 transitionEventName | |
function getTransitionEndEventName() { | |
if (transitionEventName !== undefined) { | |
return transitionEventName | |
} | |
var detectedTransition, | |
el = document.createElement('transitiondetector'), | |
transitions = { |