transitionend (webkitTransitionEnd) (MSTransitionEnd?)animationstart animationend animationiteration(webkitAnimationStart, webkitAnimationEnd, webkitAnimationIteration)(MSAnimationStart, MSAnimationEnd, MSAnimationIteration) http://tinyurl.com/lokazv4
http://prefixr.com - vendor prefix preprocessor
http://leaverou.github.io/prefixfree/ - runtime processor
http://css-tricks.com - lots of ccs tricks
http://css3please.com - css3 demos
http://daneden.me/animate/ - animate.css effects library
http://css3playground.com - some cool effects
(watch code and validate on the fly)timmy wilson, writer of swizzle
<parent>
<style scoped>
@import url(whatever);/*sweet*/
ul li { background: blue; }
</style>
<ul><li>blue</li></ul>
</parent>
<ul><li>notblue</li></ul>
:matches() /* 'or' group your selectors (only compound selectors, no combinators)*/
a:link, a:visited, a:hover, a:active
/* becomes */ a:matches(:link, :visited, :hover, :active)
div#main, div.animated, div.visible
/* becomes */ div:matches(.animated, .visible, #main)
:not(:link, :visited) //opposite of matches
label /for/ input { display: none }<label for="someid">hidden</label><input id="someid"/>
.superman[data-power='flying' i]
:any-link { color: blue; } :local-link { color: red; }
:local-link(3) { color: orange;} /* number is for depth http://x.com/1/2/3/ */
<style>:blank { color: red;} :empty { color: blue; }
<p> </p><!-- ← red --><p></p><!-- ← blue -->
p.foo:nth-match(even) /* !!! */
option:nth-match(-1n+4 of :selected) /* first four */
Subject Selector (! or $)?
/* sets the background of the containing li on hover */
nav > ul > $li > a:hover { background: gray }/* add shadow to the containing ul on hover */
nav > $ul > li > a:hover { box-shadow: 0 0 10px black }
:scope (same as <style scoped>)
<p id="outside-scope">not green</p>
<section>
<style scoped> p {background: green;}; /*or*/ :scope p {background: green;}</style>
<p>is green!</p>
</section><script>section.querySelectorAll(':scope p');//super fast!</script>
jQuery.find = function(selector, context) {
return context.findAll(selector);
}
npm install express && express PROJECT_NAME --css stylus && cd PROJECT_NAMEnpm install && node app.js & links http://localhost:3000
The industry average is 15 - 50 errors/kloc1.
1) Steve McConnell. Code Complete, 2nd Edition, 2004.
Tests demonstrate correct performance of specific tasks under highly constrained circumstances.
They do not prove the absence of bugs.
In fact, your users will encounter precisely those bugs that you did not write tests for.
Even if you had 100% coverage, (which you don't) testing cannot prove correctness.
onerror handlerThis is your last line of defense.
If you get here, you are crashing.
In an onerror handler, you get the error message and the line number and URL where the error originated.
window.onerror = function (message, url, line) {
ExampleApp.crash(message, url + '\n' + 'line: ' + line);
};Never catch an exception you can't do anything about.
If you catch an exception you cannot handle,
always re-throw the same exception.
If you catch an exception in your top-level code that you
cannot handle, crash.
Never throw in a callback.
especially yui!
Wrap code that can throw in try/catch blocks.
function safeCallback(fn) {
return function () {
try {
return fn.apply(this, arguments);
} catch (e) {
ExampleApp.crash(e.name + ': ' + e.message, e.stack);
}
};
}
When using callbacks, always provide an error handler
$.ajax('http://api.example.com/foo/bar', {
success: safeCallback(function (result) {
// ...
}),
error: safeCallback(function (jqXHR, textStatus, errorThrown) {
// ...
})
});
Always provide a fail handler when using promises
$.ajax('http://api.example.com/foo/bar').
done(safeCallback(function (result) {
// do something cool...
})).
fail(safeCallback(function (jqXHR, textStatus, errorThrown) {
// handle the error...
}));


Computers are deterministic: given the same inputs, they will always arrive at the same result.
Capture input to a log.
Later, run the program again and replay the captured input.