Skip to content

Instantly share code, notes, and snippets.

@th3hunt
th3hunt / dashboard.js
Last active October 16, 2017 15:12
Chain PageObject methods with Intern.js, by having each PageObject instance using a new/enriched remote Command
define(function (require) {
var Page = require('./base/page')
, _ = require('vendor/lodash/lodash.underscore');
function DashboardPage() {
Page.apply(this, arguments);
}
DashboardPage.prototype = Object.create(Page.prototype);
@hilios
hilios / gist:1284170
Created October 13, 2011 12:57
Nginx YSlow performance boost w/ Gzip + Far future expires Header
server {
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files

Debug Workshop

General tips

❉ Create a new user in Chrome just for use with debugging, ensures no plugins or extensions are adding JS to the page and confusing the issue. Extension code and iframes will show up when you're trying to profile code and get in the way. You're aiming for as close to a totally vanilla browser tab as possible.

❉ Be aware Chrome dev tools add a fair bit of CPU/memory overhead to the page

❉ "Art" of debugging: replicate, isolate, eliminate. Replication is the hardest part. "Works for me" not really an acceptable answer.