Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thefella on github.
  • I am thefella (https://keybase.io/thefella) on keybase.
  • I have a public key ASA_JQD1W_nuV9BWZiMiisTMrCjkTDETlz6SzWTpg8mK2Qo

To claim this, I am signing this object:

@thefella
thefella / ie_mediaquery.css
Created March 31, 2014 09:51
Media Queries for old IE
/* IMPORTANT: X-UA-Compatible needs to be "IE=7,IE=9,IE=edge"
** This doesn't always work in the HTML, so needs set via the server headers
** IE7 and less will apply whatever is in the media queries. (The actual mq statement is ignored due to the \9)
** IE8, due to the header code, will act like IE7 and therefore see point above
** IE9+ will use the media queries like a proper browser
**
** Desktop version: IE8 and below
** Responsive version: IE9+, modern browsers
*/
@thefella
thefella / ligatures.css
Last active December 12, 2015 07:48
Get ligatures on the go with CSS / LESS
.ligatures {
text-rendering: optimizeLegibility;
-moz-font-feature-settings: "liga=1, dlig=1";
-moz-font-feature-settings: "liga", "dlig";
-ms-font-feature-settings: "liga", "dlig";
-o-font-feature-settings: "liga", "dlig";
-webkit-font-feature-settings: "liga", "dlig";
font-feature-settings: "liga", "dlig";
-moz-font-variant-ligatures: common-ligatures discretionary-ligatures;
-ms-font-variant-ligatures: common-ligatures discretionary-ligatures;
@thefella
thefella / gist:3513221
Created August 29, 2012 14:16
Detect if browser request is a prefetch or prerender using PHP
if ( (isset($_SERVER["HTTP_X_PURPOSE"]) and (strtolower($_SERVER["HTTP_X_PURPOSE"]) == "preview")) or
(isset($_SERVER["HTTP_X_MOZ"]) and (strtolower($_SERVER["HTTP_X_MOZ"]) == "prefetch")) ) {
// Request is a prerender or prefetch
} else {
// Request is 'normal'
}
@thefella
thefella / gist:3431023
Created August 23, 2012 01:12
Favicons, mobile icons and launch screens
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-57x57-precomposed.png">
<link rel="icon" type="image/png" href="/apple-touch-icon-57x57-precomposed.png">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-startup-image" media="only screen and (max-device-width: 480px) and not (-webkit-min-device-pixel-ratio: 2)" href="/apple-touch-startup-image-320x460.png">
<link rel="apple-touch-startup-image" media="only screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="/apple-touch-startup-image-640x920.png">
<link rel="apple-touch-startup-image" media="only screen and (min-device-width: 768px) and (orientation: portrait)" href="/apple-touch-