start new:
tmux
start new with session name:
tmux new -s myname
| var casper = require('casper').create(); | |
| var webpage = "http://wordpress.org/"; | |
| casper.on('resource.requested', function(resource) { | |
| for (var obj in resource.headers) { | |
| var name = resource.headers[obj].name; | |
| var value = resource.headers[obj].value; | |
| if (name == "User-Agent"){ |
| var casper = require('casper').create(); | |
| casper.start(); | |
| casper.open('http://borisschapira.com/'); | |
| casper.then(function dumpHeaders(){ | |
| this.currentResponse.headers.forEach(function(header){ | |
| console.log(header.name +': '+ header.value); | |
| }); | |
| }); |
| // get a Casper object. | |
| // See http://casperjs.org/ | |
| var casper = require('casper').create(); | |
| // this will be evaluated inside the context of the window. | |
| // See http://casperjs.org/api.html#casper.evaluate for notes on | |
| // the difference between casper's running environment and the | |
| // DOM environment of the loaded page. | |
| function testReporter(){ | |
| // casper is webkit, so we have good DOM methods. You're |
| var system = require('system'); | |
| if (system.args.length < 5) { | |
| console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
| phantom.exit(); | |
| } | |
| var account = system.args[1]; | |
| var username = system.args[2]; | |
| var password = system.args[3]; |
| ========================================== ========================================== | |
| TMUX COMMAND WINDOW (TAB) | |
| ========================================== ========================================== | |
| List tmux ls List ^b w | |
| New new -s <session> Create ^b c | |
| Attach att -t <session> Rename ^b , <name> | |
| Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
| Kill kill-session -t <session> Close ^b & |
Here are a list of headless browsers that I know about:
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
| /* | |
| * Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
| * These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
| * | |
| * Usage: | |
| * $ casperjs screenshots.js http://example.com | |
| */ | |
| var casper = require("casper").create(); |