WebPagetest - Website Performance and Optimization Test
- Analytical Review
- Test Location
- Browser
- Advanced Settings
- Visual Comparison
'Dulles, VA - IE 9'
- Mobile = Akamai's Mobitest
WebPagetest - Website Performance and Optimization Test
'Dulles, VA - IE 9'
<html> | |
<body> | |
<!-- ----------------------------------------------- --> | |
<!-- inline script block with commented code inside: --> | |
<!-- ----------------------------------------------- --> | |
<script id="myjscode"> | |
/* | |
(function(h,v){function q(b){if(""===m)return b; |
if(process.env.WEB_DRIVER_PORT == null){ | |
process.env.WEB_DRIVER_PORT = 4444; | |
} | |
var webdriverPort = process.env.WEB_DRIVER_PORT; | |
var childProcess = require('child_process'); | |
var phantomjs = require('phantomjs'); | |
var fs = require('fs'); | |
var mkdirp = require('mkdirp'); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
// from fiddle http://jsfiddle.net/drzaus/pWe6W/ | |
// even better : https://gist.github.com/bgrins/5108712 | |
_log = (function(undefined) { | |
var Log = Error; // does this do anything? proper inheritance...? | |
Log.prototype.write = function (args) { | |
/// <summary> | |
/// Paulirish-like console.log wrapper. Includes stack trace via @fredrik SO suggestion (see remarks for sources). | |
/// </summary> | |
/// <param name="args" type="Array">list of details to log, as provided by `arguments`</param> |
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
#!/usr/bin/env node | |
'use strict'; | |
var spawn = require('child_process').spawn; | |
var args = [ | |
'--harmony', | |
'app/bootstrap.js' | |
]; |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |