This file contains hidden or 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_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain | |
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json | |
</IfModule> |
This file contains hidden or 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
#!/bin/sh | |
echo "[post-rewrite hook: $1]" | |
# noah grant | |
# quick script to call bower install and npm install automatically if | |
# bower.json or package.json are changed, respectively | |
# this assumes one top-level file for each | |
changedfiles=( `git diff-tree --no-commit-id --name-only HEAD@{1} HEAD` ) |
This file contains hidden or 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
// via http://stackoverflow.com/a/14397066/999162 | |
var matrixToArray = function(str){ | |
return str.match(/(-?[0-9\.]+)/g); | |
}; | |
matrixToArray('rgba(0, 0, 0, 0.5)'); // => ['0', '0', '0', '0.5'] | |
matrixToArray('matrix(1, 0, 0, 1, -770, 0)'); // => ['1', '0', '0', '1', '-770', '0'] |
This file contains hidden or 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
/(Windows Phone)|(XBLWP)|(ZuneWP)/.test(navigator.userAgent)&&$("body").addClass("no-fontface"); |
This file contains hidden or 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 ((window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth)> someMediaQueryBreakpointPointToMatch) { | |
... | |
} |
This file contains hidden or 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
Array.prototype.remove = function(from, to) { | |
var rest = this.slice((to || from) + 1 || this.length); | |
this.length = from < 0 ? this.length + from : from; | |
return this.push.apply(this, rest); | |
}; | |
if (!Array.prototype.indexOf){ | |
Array.prototype.indexOf = function(elt /*, from*/) | |
{ | |
var len = this.length >>> 0; |
This file contains hidden or 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
Object.size = function(obj) { | |
var size = 0, key; | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) size++; | |
} | |
return size; | |
}; |
This file contains hidden or 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
$(function () { | |
var resizeTimer; | |
$(window).resize(function() { | |
clearTimeout(resizeTimer); | |
resizeTimer = setTimeout(onResize, 50); | |
}); | |
onResize(); | |
function onResize() { | |
var $container = $("#container"), |
This file contains hidden or 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 something = something === true; // something will always be 'false' except for explicit 'true' | |
var something = something !== false; // something will always be 'true' except for explicit 'false' |
This file contains hidden or 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
function is_touch_device() { | |
return 'ontouchstart' in window // works on most browsers | |
|| 'onmsgesturechange' in window; // works on ie10 | |
}; |