Most of the PHP I write runs on Bluemix - it's IBM self-service cloud, and since I work there, they pay for my accounts :) There are a bunch of databases you can use there, mostly open source offerings, and of course with PHP I like to use MySQL. Someone asked me for my connection code since it's a bit tricky to grab the credentials that you need, so here it is. Continue reading
I'm working on a project at the moment (a PHP library for CouchDB, if you must know) that is designed to make HTTP calls and therefore holds a Guzzle HTTPClient object as an object property. This is great except when I need to debug something and the output of my call to
var_dump() is several screens high ... Continue reading
An increasing number of applications now offer webhooks as an integration, often in addition to an API. The classic example, familiar to most developers, is the GitHub webhooks which can notify your other systems such as CI tooling that a new commit has been added to a branch. If you imagine how many repositories exist on GitHub, and how many other systems react to changes on each repository ... there's a reason they are excellent with webhooks! Whether it's your source control, updates from your IoT sensors, or an event coming from another component in your application, I have some Opinions (TM) about handling webhooks, so I thought I'd write them down and include some code as well, since I think this is an area that many applications will need to work with. Continue reading
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:
I mostly use OpenWhisk with NodeJS (which is lucky for me, it's the best supported of the languages and default for the documentation examples!) and while there are a bunch of npm modules already installed on OpenWhisk, sometimes there will be others that you also want to include. Alternatively or additionally, you might also want to deploy your
package.json since this can specify the entry point if it's not
index.js which is the default.
Having an Amazon Echo Dot in my office is quite fun, and I've accidentally started writing more skills and giving a few talks about building skills for the Alexa toolchain. Today I created a skill that uses multiple steps to make a conversation and thought I'd better write down what I did so I'd be able to remember!
The basic idea is that when creating the "intent", i.e. the action that you want Alexa to do, you also define "slots". The slots are the variables; if this were a command line tool, they'd be the arguments you typed. It's possible to include both intent and slots in your wording when you speak to Alexa, but equally you can just invoke the skill and have it prompt you for the rest of the information. Continue reading
I love OpenWhisk but I struggled a little to get the parameters attached in a sane way for a while so I am capturing my notes here for future reference! Parameters can be attached to actions or packages; I tend to break my actions down really small and pass data into them, while preferring to set parameters on the package that the actions belong to. Continue reading
Did GitHub change their activity feed? Or am I getting more confused now I contribute to so many different projects that I'm not a maintainer of? Either way, I struggle sometimes to find the pull request or issue that I had a discussion on to revisit or continue that discussion (yes, I get email notifications - and no, I don't take good enough care of them to find things that way).
GitHub has brilliant advanced search functionality, and what I wanted was:
is:pr commenter:lornajane sort:updated-desc
Which gives me a list of all the pull requests I've commented on, with the most recent first. I couldn't remember the exact repo name and I also often switch
is:issue as appropriate, but this search string has been very helpful for finding those odd things you want to follow up on.
Do you have a favourite GitHub search string combination? Would you care to share it in the comments? Thanks :)
I work quite a bit with CouchDB (Cloudant, a hosted CouchDB solution, is part of Bluemix, IBM's cloud platform - and I work for IBM so I get to use this as much as I like) and today I found a feature I hadn't seen before. I struggled to find the docs, so I thought I'd post my working example here in case anyone else is solving a similar problem: wanting to use more than one set of key ranges when filtering a CouchDB view. Continue reading
Working with openwhisk, it's easy to create many isolated actions and build them up into sequences; the output of one action is passed to the next action in the sequence. In my case, I wanted one action to spawn potentially many other actions. I had to look up how to do it and here it is so I can look it up more quickly next time! Continue reading