I should note that these are all essentially general purpose plugins. Some of the language-specific ones are great to use, but unless you’re working with that particular language they’re not going to be that useful.
Any screenshots are taken from the plugin website, rather than grabbed by me, unless explicitly noted.
This is where it all starts. It’s very simple to use — I…
I’d been putting something together in Phoenix, and one of the pages kept throwing an error that it couldn’t find
item_path/3. This was odd, as the generating code in the template had four arguments.
The same thing happened when I broke into IEx to poke at it:
iex(1)> Routes.page_path(conn, :index, user_id: user.id, item_id: item.id)
** (UndefinedFunctionError) function AppWeb.Router.Helpers.item_path/3 is undefined or private. Did you mean one of: * item_path/4
People familiar with Elixir can already spot the problem…
key: value, key: value forms what's known as a keyword list. What I hadn't expected was that those…
I’ve noticed when using
tsc in watch mode that sometimes — especially if a file has been renamed — it doesn’t realise the file needs recompiling. This state persists across reboots, restarting the watcher, all the usual stuff.
The last time I hit this was when I needed to re-order the seed files I’m using for this project. A file that had been last needed to be first, everything had to move around as I use numbers in the filenames to ensure the seeding order is clear. Mostly it works really well.
Renaming the files wasn’t a problem, but suddenly…
Recently I’ve been working on integration with a subscription/payment gateway (It hasn’t been straightforward, but that’s a whole other post).
I wanted to be able to test my web-hook code without repeatedly triggering events from the gateway. I stored the incoming events in JSON format, which was fine — but then of course I needed to take the stored events and do something with them.
I thought it might be interesting to make a note of where I started from and how I got to the end. I’ve included the mistakes I made along the way, so if you read…
Looking at several different editors
Since I’ve started blogging I’ve naturally needed more from my editors, in terms of both writing and organisation.
For better or worse, blogging and static site systems seem to have settled on Markdown for formatting input. It has the advantage of being fairly simple to learn and using only normal text characters for formatting.
I’ve tried various different editors for writing text — iA Writer, MarkdownPad, StackEdit, and of course Vim/Emacs. Here’s why I’ve settled on Ulysses for my editing.
It has great Markdown support, but more than that:
I had a revelation the other day.
I was of the idea that to make your UI pretty and reactive, you needed to be using Vue.js, Svelte, or some other web framework. Otherwise, the page just sat there until you clicked a button, and then reloaded. Silly, I know now.
Then I discovered Alpine.js and realized I was completely wrong.
Or, how to use Hapi pre-route handlers
As I added more methods to my latest project, I realised that there was an increasing amount of wasted effort.
In every endpoint dealing with an item, we had to fetch the item. That also meant that every endpoint also had to deal with checking the user had the right to access that item. When I started adding things belonging to things, and we then had to check the chain of ownership held, it started getting tedious.
I started to think — Express has middleware, I wonder what Hapi has? There’s bound to…
I’ve been lucky enough to discover some good new desktop and coding tools via Medium and dev.to lately. I thought I’d share some of the less common ones I use.
Insomnia is great for testing web APIs. The app is free; the company who make it do also offer paid plans for sharing the requests you’ve defined, useful if you’re in a team.
This is a really useful app for connecting to PostgreSQL instances and examining them. It’s able to look at the schemas as well as the contents of the tables, and edit them. …
The technique we’re using is the one used by Google, Microsoft, and others to verify that you’ve got some authority over a domain. So while it’s not foolproof, at least we’re in good company!
The code in this article is TypeScript, but the same method would work in most languages.
All of the verification methods I’ve seen for these rely on the user being able to modify the site in some way — which makes sense, since you’re checking if they have control over the site they’re trying to use.
Most of them seem to have settled on using some…
Software engineer in Bristol, UK. Playing around in my spare time with Nodejs, Typescript, Elixir and Phoenix, Vue and more.