Skip to content

Instantly share code, notes, and snippets.

View ryanburgess's full-sized avatar

Ryan Burgess ryanburgess

View GitHub Profile
@ryanburgess
ryanburgess / iOS Specific.html
Created December 21, 2013 16:22
Meta data for iOS specific devices. Includes bookmark icon and splash screen.
<!-- iOS Specific -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="apple-touch-icon" href="images/bookmark-icon.png" />
<link rel="apple-touch-startup-image" href="images/splash-screen.png" />
@ryanburgess
ryanburgess / GZIP
Created December 23, 2013 14:15
GZIP Compression in htaccess file
# ------------------------------------------------------------------------------
# | Compression |
# ------------------------------------------------------------------------------
<IfModule mod_deflate.c>
# Force compression for mangled headers.
# http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
@ryanburgess
ryanburgess / Browser Caching
Created December 23, 2013 14:17
Enable browser caching in .htaccess
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
@ryanburgess
ryanburgess / IE7.js
Created January 1, 2014 22:15
IE7.js is a JavaScript library to make Microsoft Internet Explorer behave like a standards-compliant browser. It fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.
<!--[if lt IE 7]><script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script><![endif]-->
@ryanburgess
ryanburgess / IE 7 Before Pseudo Hack.css
Created January 1, 2014 22:28
:before css pseudo elements hack for IE 7. Add this to the class to prevent the before pseudo from hiding the element in IE7.
*zoom: expression(
this.runtimeStyle.zoom="1",
this.appendChild( document.createElement("small") ).className="before"
);
@ryanburgess
ryanburgess / IE 7 Fix for using :before or :after.sass
Created January 1, 2014 23:05
SASS Mixin for IE 7 Fix for using :before or :after pseudo elements
// -----------------------------------------
// IE 7 Fix for using :before or :after pseudo elements
// -------------------------------------------
// example: @include pseudo-fix(before)
// example: @include pseudo-fix(after)
@mixin pseudo-fix($pseudo){
@ryanburgess
ryanburgess / prevent console log errors.js
Created January 2, 2014 01:44
Prevent console.log errors in IE
if ( ! window.console ) console = { log: function(){} };
@ryanburgess
ryanburgess / IE Fix for indexOf.js
Created January 2, 2014 05:44
A fix for IE not supporting indexOf on an array.
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i<this.length; i++){
if(this[i]==obj){
return i;
}
}
return -1;
}
}
@ryanburgess
ryanburgess / Remove Whitespace
Created January 7, 2014 01:16
JavaScript remove whitespace from a string.
String.prototype.trim = function(){return this.replace(/^\s+|\s+$/g, "");};
@ryanburgess
ryanburgess / cache the DOM element.js
Created January 7, 2014 01:22
JQuery cache the DOM element.
var nav = document.querySelector('#nav');