Run your application using: `node debug xxx.js` then use the following commands to step-through the code (note: Ctrl+D to exit the debugger)...
`cont` -> continue running
`next` -> step over next statement
`step` -> step into next statement (if possible, otherwise it just steps over)
`out` -> step out of the currently executing function
`backtrace` -> show the current call execution frame or call stack
`repl` -> start the node repl to allow you to view variable values and execute code
`watch(expr)` -> add given expression to the watch list (which is shown whenever you step through anything in the debugger)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// `f` is assumed to sporadically fail with `TemporaryNetworkError` instances. | |
// If one of those happens, we want to retry until it doesn't. | |
// If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a | |
// sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects; | |
// it has no synchronous behavior (e.g. throwing). | |
function dontGiveUp(f) { | |
return f().then( | |
undefined, // pass through success |
- The majority of the hacks will be be made a reality
- Pretty bad performance bug was found and fixed!
- The Rashboard hack will help developer teams understand the real-time performance of the site
- Everyone was excited about the potential of RUM data after James's talk
- N&K data developers joined in and were keen to develop ideas useful to News
- Great to see the unsurmountable stairs between floor 3/4 start to break down as everyone worked and chatted in the same space for 2 days
Update
This snippet is now improved and officially an npm module called dom-handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var Graphic = React.createClass({ | |
componentDidMount: function() { | |
var context = this.getDOMNode().getContext('2d'); | |
this.paint(context); | |
}, | |
componentDidUpdate: function() { |
This let's me git clone
a template repo, cd
into and fire up a new template in my editor of choice:
$ clone starter # clones https://github.com/addyosmani/starter (a personal boilerplate)
$ clone h5bp html5-boilerplate # get me HTML5 Boilerplate
$ clone angular angular-seed # same for AngularJS seed
$ clone polymerlabs seed-element # same for a new Polymer element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("twitter.com") { | |
/* styles for collapsing media in tweets and showing an arrow to indicate their existence | |
but only at the top level */ | |
ol.stream-items > .expanding-stream-item:not(.open) .OldMedia, | |
ol.stream-items > .expanding-stream-item:not(.open) .AdaptiveMedia { | |
display: none; | |
} | |
OlderNewer