Stylized Alex Ward logo


Stencil e2e testing on WSL

I ran across something while working on updating Stencil tests to use puppeteer, and figured I'd put it down to paper while I'm thinking about it.

In order to run puppeteer tests, a browser needs to be present. Now, you could probably install headless chrome in the linux subsystem (and also install a window manager because evidently puppeteer needs that in order to do some of the tests) - but that seemed a little dirty. When I was running with karma I simply set the $CHROME_BIN environment variable to point at '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe' - so that Karma will use the browser already installed on the Windows side of things. That interop works fine, so I figured I should go ahead and get that working in Stencil / puppeteer.

The config is relatively straightforward, but I did have to go digging in the source to figure out exactly what params to set.

Turns out it's just 2 things that need to be added to stencil.config.js:

exports.config = {
testing: {
browserHeadless: false,
browserExecutablePath: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'

That'll spawn a new window (the headless false part, running it in headless mode just timed out) - but retain the sandbox. Otherwise the tests run just fine.

Eleventy Rewrite + Netlify

Hey there! Long time no see.

I've been super busy doing stuff that isn't working on my personal site that I've not had any time to update it whatsoever. But since it's the holiday season and I have some time, I figured I'd rewrite it in Eleventy. Turns out it was super easy to convert from Metalsmith to Eleventy, thanks to the static blog starter. It did a huge amount of the work for me.

Over the next...whenever I can make time for it.... I'll be updating the styles to not look like the site was made by someone who has zero eye for design (it me!).

Also! The site is now deployed on Netlify, which was super easy to set up. Like, 2 commands and it's running easy. Even integrates with my private gitlab instance. So good.

GW2 Assistant Update

So! I've not actually posted about this, but I've launched a small iOS app GW2 Assistant.

Since then, we've had some issues with the local cache never clearing and the app not updating data. Because of those issues and the fact that Ionic 3 is hitting beta shelves, I'm in the process of completely rewriting the whole thing. This time, we're using redux to pass information around and persist - and leveraging some of the new quirks of Ionic 3 to hopefully tamp down on some of the issues.

Stay tuned!

Site Now in Metalsmith + Let's Encrypt

Metalsmith Rework

I recently got the bug to try something new and run my site using a static site generator instead of Drupal.

There are several reasons:

  1. I wasn't really using any of the features of Drupal, and having a static site committed somewhere made more sense.
  2. I've been writing more and more JS things, and since PHP is my day job I thought it'd be nice to have something else.
  3. Metalsmith had been brought up before, as had Hexo and a couple of others (there are a few php ones as well, along with Jekyll for ruby).
  4. The computer I was working on had npm installed but not php (it was windows, and I didn't want to type choco install php)

I ultimately went with metalsmith because it looked cool, and the idea of its render pipeline. There are also a bunch of plugins and the plugin api is pretty easy to understand once you've got it figured out.

Couple of problems I ran into:

  1. The render pipeline takes a bit of trial and error in order to get right.
  2. Plugin documentation doesn't always include examples.
  3. Sometimes the generator creates some weirdness with regards to the template plugin (header repeated, double titles, etc.).

Let's Encrypt

I've also switched the SSL certificate to use a beta cert from Let's Encrypt. It was fairly easy to get going (there's an automated installer to generate and pull down the cert) and it seems to be working just fine. It's a pretty cool initiative which I hope eventually gets everything behind SSL.

Why you should write in Markdown

What's all this then?

I had a bit of free time this afternoon, and decided I should take a moment to talk about one of my favorite things: Markdown. In the post, I'd like to talk about what I've been using Markdown for and a few of the services and tools I've been looking at and using. Hopefully it'll be useful!

Markdown is awesome

Let's get this disclaimer out of the way up front. I <3 Markdown. I use it to write basically everything (this post brought to you by the Markdown Module ). It's not for everyone, and for publishing it's not going to replace Publisher or Pages anytime soon, especially for things with highly complex layouts.

In my case, Markdown fits my needs very well.

Writing is awesome

Since we've established that Markdown is awesome (for me), it follows that getting to write things in Markdown is also essential. Even more so when you can do things like write standard reports, books, and anything else that could potentially be published in Markdown.

Thus, recently I've been working with Gitbook - a publishing platform and node package which can convert structured Markdown files into a book, which is styled according to the default gitbook css. At Acquia, my team has also been doing a fair amount of work with using GitBook's open source node module to write reports in.

I have to say that GitBook is a pleasure to work with. I find myself spending less time having to deal with formatting quirks, and more time proofreading and writing the things I want to produce.

Why GitBook is nice

With GitBook, the way it wants you to structure your book makes it pretty intuitive to keep the file structure well aligned with the structure of your outline.

At minimum, you need a and a The summary file contains the outline of your book, chapters, subchapters, etc. This can then be used to automatically generate folders for your book to go into using the gitbook init command. Double fun, because it's smart enough to not overwrite files that already exist, so you can use it to stub out files for you while you're working.

The README serves as the summary file for the book, and appears at the front as an introduction. Both of these files are configurable by editing the book.json file and pointing them to different locations.

Want a cover? No problem. By default simply placing a cover.jpg file in that directory will produce a book cover. You can also change what this file is with config values in book.json.

Once you've written a bunch and want to convert your book into a pdf or epub file, gitbook has you covered there too (though you do need calibre installed to do it properly).

All in all, it makes my life easier since it takes away the pain of having to deal with a full-fledged Word Processor which may or may not generate things in a consistent manner.

GitBook Editor

For my workflow, I use Atom to write the book and then make use of the gitbook serve command in order to preview changes to my book as I'm writing. It's a workflow that works really well for me.

However, GitBook also provides a really slick editor that hooks nicely into their service (the publishing platform). It does the same kinds of things that I do in Atom, but also provides a WYSIWYG editor side pane (which Atom can also do), and a lot of nice features for speeding up editing if you don't want to just type the Markdown.

Publishing to

I've not done this yet, but the whole process seems pretty reasonable. If you choose to charge for your book, you receive 80% royalties. There's also a mechanism for taking donations, however I'm not 100% sure how that works.

And now for something completely different

I'm happy to also be acquainted with the creator of Remarq, a Markdown-based report generation tool. It generates beautiful PDF reports from your Markdown content and then templates it for you based upon some configuration settings which you can generate. Basically it allows you to create super-slick looking reports without having to futz with trying to make them look pretty.

Great if you're very focused on the content of a report and want to still create something visually appealing to the report's intended audience.

I don't personally use this for anything at the moment, but it's awesome and helps push my "Markdown for everything" agenda.

In Closing

Just give Markdown a shot, there are tons of editors you can play with and get previews on, and the syntax is super easy to use. Commonmark provides a basic spec and introduction, and Github has a nice Markdown Basics page which should help a lot.


Techlahoma Chat Bot take 2

So it has been a while since I first talked about creating amandaharlin_v2, and I figured it was time for an update.I originally spun up _v2 on Digital Ocean (which is what is hosting this blog), and everything worked out pretty well.

However, this left some things to be desired, as I was the only one in control of the server, and since I wasn't using any kind of node process manager. If irc would disconnect for extended periods of time, or the node process would die for any reason, I'd have to manually go restart the bot. Additionally, there wasn't an easy way to give access to the administrators of #techlahoma.

This is why I receently moved amandaharlin_v2 over to Heroku. The instructions for this are actually very well documented, and the process is not all that difficult.

The very first thing that you need to do is create the heroku app, which can be done with the heroku command line:

cd techlahoma-bot
heroku create

This automatically adds the heroku git repo url to the git repository within which the command was run.

After that, it's just a matter of using heroku:set to create the appropriate environment variables:

heroku config:set HUBOT_IRC_NICK=&quot;amandaharlin_v2&quot;
heroku config:set HUBOT_IRC_ROOMS=&quot;#techlahoma&quot;
heroku config:set HUBOT_IRC_SERVER=&quot;;
heroku config:set HEROKU_URL=

That last one is used to ensure the application pings itself at the appropriate interval to ensure that it doesn't timeout when inactive.

Finally, the only last thing you need to do when pushing the bot is to update the Procfile in order to actually start the app:

web: bin/hubot -a irc -n amandaharlin_v2

After that, we're done! Huzzah.

The added bonus here is that I can also grant access to the various #techlahoma leadership to adminster the app directly instead of having to create ssh accounts for them.