Skip to content

Instantly share code, notes, and snippets.

View cbfranklin's full-sized avatar

Connor Franklin cbfranklin

  • E*TRADE
  • New York
View GitHub Profile
@cbfranklin
cbfranklin / jquery.hasClasses.js
Created March 20, 2017 16:06 — forked from mflorida/jquery.hasClasses.js
jQuery.hasClasses() plugin
/*!
* jQuery.hasClasses plugin
*
* Check if an element has ALL classes
* or ANY of a number of classes
*
* usage:
* $('#el-id').hasClasses('foo || bar') <- has EITHER 'foo' or 'bar'
* $('#el-id').hasClasses('|| foo bar') <- has EITHER 'foo' or 'bar'
* $('#el-id').hasClasses('any: foo bar') <- has EITHER 'foo' or 'bar'
@cbfranklin
cbfranklin / APACHE: .htaccess pushstate
Created March 2, 2017 20:41 — forked from rayfranco/APACHE: .htaccess pushstate
.htaccess for HTML5 Pushstate support
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</ifModule>
var ieUserAgent = {
init: function () {
// Get the user agent string
var ua = navigator.userAgent;
this.compatibilityMode = false;
// Detect whether or not the browser is IE
var ieRegex = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (ieRegex.exec(ua) == null)
this.exception = "The user agent detected does not contai Internet Explorer.";