Skip to content

Instantly share code, notes, and snippets.

View JTLR's full-sized avatar

Joe Taylor JTLR

View GitHub Profile
@JTLR
JTLR / stylable-text-selection.css
Created July 1, 2014 11:57
Stylable text selection
::selection {
background-color: #333;
}
::-moz-selection {
background-color: #333;
}
@JTLR
JTLR / svg_with_fallback.html
Created June 30, 2014 14:52
SVG image with PNG fallback
<svg width="96" height="96">
<image xlink:href="svg.svg" src="svg.png" width="96" height="96">
</svg>
@JTLR
JTLR / user-agent-match.js
Created June 2, 2014 14:25
Function to detect and match a user agent string
function detectFromUserAgentString(stringToMatch) {
var userAgentString = navigator.userAgent.toLowerCase(),
result;
if (userAgentString.search(stringToMatch) > -1) {
result = true;
} else {
result = false;
}
return result;
}
@JTLR
JTLR / styled-placeholders.scss
Created April 23, 2014 15:09
Style placeholders
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder {
color: red;
}
::-moz-placeholder {
color: red;
}
:-ms-input-placeholder {
@JTLR
JTLR / .htaccess
Created March 4, 2014 16:19
Disable compatibility mode on IE
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</IfModule>
<IfModule mod_headers.c>
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
# We need to inform proxies that content changes based on UA
@JTLR
JTLR / meta-viewport.html
Last active April 12, 2017 09:25
Meta viewport
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
@JTLR
JTLR / meta-apple-web-app-capable.html
Last active April 12, 2017 09:25
Meta Apple web app capable
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@JTLR
JTLR / meta-apple-touch-icons.html
Last active April 12, 2017 09:25
Meta apple touch icons
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/images/apple-touch-icon-152x152-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/images/apple-touch-icon-120x120-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/images/apple-touch-icon-76x76-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon-precomposed.png">
@JTLR
JTLR / responsive-embed.scss
Created February 24, 2014 22:16
Responsive video embed
.embed {
position: relative;
height: 0;
padding: 0 0 56.25% 0; // 16:9
overflow: hidden;
iframe,
object,
embed {
position: absolute;
top: 0;
var SITE = SITE || {};
SITE.fileInputs = function() {
var $this = $(this),
$val = $this.val(),
valArray = $val.split('\\'),
newVal = valArray[valArray.length-1],
$button = $this.siblings('.button'),
$fakeFile = $this.siblings('.file-holder');
if(newVal !== '') {