Selective prose linting with Vale’s glob switch

Vale is an open source CLI tool for linting prose (if you’re not linting prose yet, why not? I never want to go back). I typically use it for everything, locally and in CI, and it’s especially valuable now I’m working for a company that uses US English. You’d think that most of the challenges would be caused by the majority of non-native English language contributors? Nope, most of the chaos comes from the token Brit :)

I ran into one challenge though where I didn’t want to enable Vale for everything: a large internal documentation repo. This is the catch-all of things we should share with one another and like most internal company documentation sites, there is a lot going on. I assembled a very minimal set of Vale rules and still the first pass netted me over 10k errors. Luckily, Vale has a --glob option, but it took me a while to find how to exclude multiple files and directories using it, so here’s the example for future-me, and anyone else who needs to see it! Continue reading

Planets and Webhooks: a simple Flask app

As a Developer Advocate for an API company, I spend a lot of time talking about APIs and webhooks and HTTP in general. Recently I’ve been focussing on HTTP tools, but I really wanted a very simple example API that I could use that would return JSON but really let me focus on the tools, not the API. So I created a “Planets and Webhooks” API with a couple of GET endpoints to return JSON data, and another endpoint to receive and log incoming webhook data. Continue reading

Handy Beanstalkd Admin Console

I’ve been building apps with queues lately and mostly using beanstalkd as my queue because it is very simple, very fast and on my platform it is [apt install beanstalkd] -easy to install. I have also been using a handy web interface for beanstalkd which I like so much that I felt I ought to share! It’s beanstalk-console, which is a PHP-based web interface to one (or many) beanstalkd servers. Continue reading

Test Web Requests with a Local RequestBin

I’ve been a long-time fan of RequestBin, but it’s no longer active since it suffered so much bad traffic. It’s never been too difficult to set up locally and when I tried to do that last week, I realised it has got even easier because it now has a docker-compose configuration. Continue reading

HTTP Tools Roundup

At a conference a few days ago, I put up a slide with a few of my favourite tools on it. I got some brilliant additional recommendations in return from twitter so I thought I’d collect them all in one place in case anyone is interested – all these tools are excellent for anyone working APIs (so that’s everyone!). First, my original slide:

Continue reading

Notify New Relic of Jenkins Deploys

I’m a fan of Jenkins as a build server, and on one particular project we’ve also started using New Relic (I haven’t figured out how to blog fun things about New Relic without sharing graphs of client applications which doesn’t seem like a cool thing to do). New Relic has a feature where you can notify it when you do a deployment, and it shows on the graphs a line marking when that happened, which is super useful for correlating performance changes with code changes.

new-relic-deploy

Continue reading

Scaling and Sizing with PDFJam

I find myself needing to take a PDF, output it at a specific size, and have the result offset to the top right hand side of the screen. To achieve it, I needed a few new switches to my good friend PDFJam, so I thought I’d share my command!

pdfjam --suffix converted --papersize '{1920px,1080px}' --scale 0.4 --trim "-6cm -1cm 13cm 8cm" slides.pdf

The --suffix is instead of giving an output filename, whatever you feed in ends up with the suffix in its filename. This is very handy because I use this command in a script and only need to pass in one variable. The --papersize isn’t a switch I have used before either but you can set exact sizes for the final output which is nice. The --trim switch can also be used to set --clip=true to remove the trimmed space from the document if desired.

I find PDFJam a very handy tool but with not nearly enough blog posts and code snippets around, so I’m dropping my command for future reference (yours as well as mine!).

Gollum the Git-Enabled Wiki

In trying to get company documentation off google docs and people’s laptops and into a more useful format, I have been researching developer-friendly tools for business documentation. Requirements went something like:
– must handle words and documents
– should be available locally, bonus points for revision history
– must publish to the web, and ideally be editable there
– should accept content in markdown
– must have access control (which wiped out my original plan of using a static site generator)

While I worked on this, we were using the wiki feature in GitLab … which pretty much hit the nail on the head. Further investigation showed that the wiki feature in GitLab (and indeed in GitHub) is a ruby gem called Gollum. Continue reading

Set Up Your First Hubot

It took me far too long to get my first hubot working; when I finally sat down to get it going the process was much easier than I expected! So here’s a little guide in the hope that this helps you get started too.
Continue reading

Hubot and Slack

I’m enjoying using hubot to integrate services very easily and both give updates and respond to commands in chat. One of my hubots chats to us in slack rather than in IRC, and there are a couple of gotchas that I wish I’d known about before I started!

  • Hubot will not respond to you in PM, you need to join a channel and then /invite @hubot and your bot will join you in that channel and then respond when you address him/her by name
  • When configuring channel names for slack (I use the gitlab plugin which needs a GITLAB_CHANNEL environment variable), do NOT include a # at the start of it if you use slack – works a treat in IRC, but skip it for slack. I spent quite a while looking for a bug in the slack adapter before I figured this one out so it’s written here for me to look up next time!
  • Also note that your hubot can only speak in channels that it has joined; I have seen hubot actually crash when asked to speak in a channel that exists but which isn’t known to it.

I think this central way of having plugins which can integrate with many messaging platforms on one side, and integrate with many external APIs on the other means we’ll be doing much more in chat ops moving forward. Already I’m impressed by how many of the hosted tools I use have webhooks, although there aren’t hubot plugins for all of them (yet!).