Forked from here, but let's use Markdown.
⌘T
go to file⌘⌃P
go to project⌘R
go to methods⌃G
go to line
Forked from here, but let's use Markdown.
⌘T
go to file⌘⌃P
go to project⌘R
go to methods⌃G
go to line/** | |
* This casper scipt checks for 404 internal links for a given root url. | |
* | |
* Usage: | |
* | |
* $ casperjs 404checker.js http://mysite.tld/ | |
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42 | |
*/ | |
/*global URI*/ |
This gist is based on this one.
// longest-request.js
var casper = require("casper").create();
var utils = require("utils");
var url = casper.cli.get(0);
var times = [];
function add0(a, b) { | |
return a + b; | |
} | |
add0(1, 2); | |
// Now, what if I want to add multiple numbers? | |
add0(1, 2, 3); | |
function add1() { | |
return [].reduce.call(arguments, function(a, b) { |
As kindly requested :)
var x = require('casper').selectXPath
run()
final callremoteScripts
option as wellthis.test.assertEval(function(title)}, 'google.fr title is "Google"', 'Google');
should be this.test.assertEval(function(title)}, 'Google', 'google.fr title is "Google"');
casper: | |
make killserver | |
python manage.py runserver 9999 & | |
sleep 1 | |
-casperjs test tests/casper/ | |
make killserver | |
casper-v: | |
make killserver | |
python manage.py runserver 9999 & |
casper: | |
make killserver | |
python manage.py runserver 9999 & | |
sleep 1 | |
-casperjs test tests/casper/ | |
make killserver | |
killserver: | |
ps aux|grep "python manage.py runserver 9999"|grep -v grep|awk '{print $$2}'|xargs kill |
View this code at http://livecoding.io/5124074
<html> | |
<head> | |
<title>My page</title> | |
<script> | |
window.onbeforeunload = function() { | |
alert('plop'); | |
} | |
</script> | |
</head> | |
<body> |