Skip to content

Instantly share code, notes, and snippets.

@jonjaques
jonjaques / elements.html
Created July 5, 2012 21:33
HTML5 Element Page
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
@jonjaques
jonjaques / example.js
Last active October 25, 2017 06:04
Library agnostic version of jQuery's Extend
function myFunction(opts) {
var defaults = {
param1: 'foo',
param2: 'bar'
};
var options = __extend(defaults, opts);
return options;
}
myFunction({param2: 'baz'}); // { param1: 'foo', param2: 'baz' }
@jonjaques
jonjaques / bookmarklet.js
Last active May 5, 2024 21:07
jQuery Bookmarklet Template w/ Async Loading
// You create your bookmarklet by instantiating
// a new Bookmarklet function, then pass in the options like so.
// This example checks to see if the var is already defined, and makes
// sure not to overwrite it. This could happen if the user clicks on
// the bookmarklet more than once.
MyBookmarklet = MyBookmarklet || (MyBookmarklet = new Bookmarklet({
// debug: true, // use debug to bust the cache on your resources
css: ['/my/style.css'],
js: [],
@jonjaques
jonjaques / app.html
Created May 13, 2012 03:02
Less version for reusability and (slightly) more semantic HTML. Full-height 2-column fixed-width plus fluid with header.
<!doctype html>
<html lang="en">
<head>
<title>Test</title>
<link rel="stylesheet/less" type="text/css" href="app.less">
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/1.3.0/less-1.3.0.min.js" type="text/javascript"></script>
</head>
<body>
<header id="appHeader">Header here</header>