I’ve been working with Protractor a lot in recent monts, writing automated tests for the web UI of our company’s customer portal. In this post, I thought I’d share some of the lessons I’ve learned along the way, and give some practical advice.
Protractor makes it very easy to locate a specific element in your webapp for testing by writing CSS selectors. However, by using this overmuch, you’re locking your integration tests to the current structure of your app, making the tests fragile. Here’s a more robust alternative.
Say you have a couple of files that you want to serve for a while, and you happen to have Node installed on your box. Here’s three easy steps to serve the contents of a directory using Express.
Here is a very simple library of pollers written in TypeScript. It uses async / await so if you want to transpile it to ES3 or ES5 you’ll need TypeScript 2.1 or higher.
I love the solarized color scheme, specifically Solarized Dark. When I set up this blog I wanted code snippets displayed the way they are in my editor: Solarized. Styling the highlighted stuff embedded in the post itself was easy: others had already written the CSS. Based on this, here’s what I used to style embedded gists on this blog.
Here are some notes on the topic of accessibility that I took while researching the subject from the perspective of a developer.
I found myself in the position of building a lightweight i18n mechanism for the frontend of an enterprise app recently. I implemented a couple of decorators that inject translations into properties. I also extended the Gulp build process to gather all translation keys into a single file for me, which I could then use on the backend to deliver only the required translations, rather than send over the entire dictionary. Here’s how.
The Glassfish Java application server comes with a number of tools, including
pkg is a 32 bit Python application and almost all of us
run 64 bit systems. So you need a couple of compatibility libraries to run the
tool. Here’s how you do that on Ubuntu 16.04.
To set up this blog, I wrote a snippet of Jekyll template code (Liquid) to create social share links. You can find it on Github if you’re interested.
While working on my little checklist app
I needed a way to hard-wrap text entered into a
<textarea> and preserve the
linebreaks when copy-pasting it somewhere else. HTML and CSS don’t support this,
break on words whenever possible.
I have a number of frameworks, platforms and reference projects in my workspace
that I want to update daily. Rather than going to each of them and doing
git pull by hand, I’ve written a little Bash script to do it for me. I just
keep a list of all projects I want updated. Now I need only run
./up.sh once a
Here are two Bash scripts I wrote some years ago that allow you to send your
computer to sleep for a specified time and then wake up automatically. They work
I’ve posted about how to set up shipyard on your local machine. You can also use your local shipyard to manage your remote servers, but to do this you have to set up a secure connection to the Docker daemon on your server. Docker has an article which tells you how to do this. Since I’ve had to do it a couple of times over the last few days, I figured I’d make a bash script for the process.
Note: this tutorial is outdated. Check shipyard-project.com for the latest installation instructions.