Skip to content

Instantly share code, notes, and snippets.

@Golly
Golly / gist:4739020
Created February 8, 2013 13:22
CSS: Cross browser keyframes
/*-- animation --*/
@-ms-keyframes rotate /* ie */ {
from {opacity:0; left:-100px;}
to {opacity:1; left:25px;}
}
@-moz-keyframes rotate /* Firefox */ {
from {opacity:0; left:-100px;}
to {opacity:1; left:25px;}
}
@Golly
Golly / gist:4738883
Created February 8, 2013 12:55
CSS: Cross browser transitions
/* Firefox */ -moz-transition: all 1s ease; /* WebKit */ -webkit-transition: all 1s ease; /* Opera */ -o-transition: all 1s ease; /* IE */ -ms-transition: all 1s ease; /* Standard */ transition: all 1s ease;
@Golly
Golly / gist:4729464
Created February 7, 2013 08:24
CSS: Mobile first breakpoints
/*-- screen resolutions --*/
@media only screen and (min-width: 768px) { /*--From Tablet--*/
}
@media only screen and (min-width: 960px) { /*--From Desktop--*/
}
@media only screen and (min-width: 1200px) { /*--From wide screen--*/
@Golly
Golly / gist:4729359
Created February 7, 2013 07:59
Javascript: Regexp, get file name from url
var filename = src.match(/.*\/(.*)$/)[1];
@Golly
Golly / gist:4729326
Last active December 12, 2015 06:28 — forked from padolsey/gist:527683
Javascript: Detect version of IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@Golly
Golly / gist:4729301
Created February 7, 2013 07:46
Javascript: Detect Mobile & iPad
var isMobile = (function(a){if(/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-
@Golly
Golly / gist:4725717
Last active December 12, 2015 05:58
HTML: Email start template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Titulek newsletteru</title>
<style type="text/css">
table td {border-collapse: collapse;}
</style>
</head>