April 1, 2015

Faking PhantomJS's userAgent in Nightwatch.js

While working on some odd behavior with a PhantomJS driven Nightwatch.js test I had a need to change the userAgent that PhantomJS was reporting. Turns out there is a simple way to do this in the configuration file:

"desiredCapabilities": {
    "browserName": "phantomjs",
    "javascriptEnabled": true,
    "acceptSslCerts": true,
    "phantomjs.page.settings.userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
}

I suspect a similar technique can be used for many of the PhantomJS settings.

Tags: nightwatch phantomjs programming testing

January 11, 2015

grep and buffering

Recently while trying to troubleshoot a production issue I needed to tail a log and grep for some data. Problem was the data I was expecting to show up didn't. Well not exactly. It showed up about 10 minutes after I expected it to. Turns out using grep twice on a tail buffers like crazy.

tail -f /var/log/nginx/access.log | grep 1.2.3.4 | grep -i html

You can fix the delay in showing results by using the line buffered flag to the middle grep like so:

tail -f /var/log/nginx/access.log | grep --line-buffered 1.2.3.4 | grep -i html

Tags: grep

August 23, 2014

A Year Ago Today I Almost Died

No this isn't hyperbole. On August 23rd 2013 I was commuting by bicycle into work when a car made an abrupt right turn in front of me without signaling. I slammed on my brakes. I woke up on the ground, on my back, gasping for breath. I hurt. I couldn't see a thing because my glasses were missing. I have no recollection of the intervening moments. I became aware of people around me telling me to stay still until the paramedics arrived.

Continue reading "A Year Ago Today I Almost Died" »

Tags: bicycle life

January 18, 2014

Jared Spool: Delightful Content Means Business

On Thursday I attended a talk by Jared Spool, who is a leader in the study of usability. Below are a few notes from his talk that I thought might be good to share. Since I've paraphrased and condensed what he mentioned I've possibly misrepresented some nuance but hope I captured the essence.

Content is what users want right now. A key example was a commerce site where searching for "return policy" returned no results. The owners didn't think of the return policy as content but from a user's perspective that was what they wanted and it led to a lost sale.

Continue reading "Jared Spool: Delightful Content Means Business" »

Tags: usability

July 23, 2013

Quantified Self for Preventative Care

Tonight I gave a short presentation at Boston Quantified Self! about my recent experiments in Quantified Self for Preventative Care. It is still a topic I'm exploring. The talk was recorded and is available at http://vimeo.com/72048183. Great to see the continuing interest in self-tracking.

Tags: quantifiedself

About

Support