Adventures in brine

A blog about code and coding.

Fear of drowning

| Comments

Flood Aware Header

I built an app! I've built few, but this one is especially special (to me).

Flood Aware is an app for tracking water levels in your local area. The data is sourced from the Environment Agency (EA). The app started off as a personal project after buying a house right on the water, last summer; the canal to the front, and the river behind.

Async/await, readable non-blocking code

| Comments

TL;DR: Shit just got streamlined. More specifically, promises start looking cleaner when you spray them with 'Callbacks Begone'.

In this post I'm going to give you a quick demo of how easy it is to incorporate ES7's proposed Async/Await functionality into your existing ES6 code. To build the code, I'm using Babel with 'es7.asyncFunctions' enabled. You can read about my Gulp setup here.

Simple routing with JavaScript Decorators

| Comments

TL;DR:I've used decorators to generate a bunch of routes from a class.

I can't decide whether this is a legitimate use for decorators, but I knew from the moment I saw this crazy syntax that this was want I wanted to achieve.

Empty Promises: Dos and Don'ts of ES6 Promises

| Comments

UPDATE 14/06/15: Realised the existence of Promise.resolve, added info on Promise.all.

There is so much I love about the functionality and syntax coming through under the banner of ES6. One such piece of functionality, is the 'Promise'. Promises are not something that needs to be transpiled, as of writing, all but IE and Opera Mini have support out of the box. The stragglers can be polyfilled quite easily.

What follows, are three tips for using promises more effectively.

A punnet size guide to Git cherry picking

| Comments

I'd just finished a load of work on a project. I'd made my commit and was a about to push to origin, when I noticed I was on the wrong branch.

What a numpty.

Why this happened, is probably a good subject for another post. What I want to talk about is how I resolved the issue.

Consuming ES6 modules in NPM packages

| Comments

I'm going to have to start coming up with more interesting title for my posts. My eyes are watering at the thought of 'Consuming ES6 modules in NPM packages'. Maybe something more exciting, like 'Munching on the nuggets of next gen wonderment'. I'll work on it.

In this post I'm going to describe how you can make use of Babel's support for ES6 modules, and how you might consume them as NPM packages. It's pretty neato stuff and makes for very clean code. Read on!

Controlling Cordova from Gulp

| Comments

It's a story as old as time. Girl meets boy, boy has an annoying two step build process, spread across two directories. Of course I'm talking about having an awesome Gulp workflow, with a Cordova project clumsily tacked on the side. Well, no more, now you can integrate Cordova! into Gulp! Yay!

In the name of Gulp

| Comments

TL;DR: Use Gulp 4 if you care about task management. If you can't use Gulp 4, use Gulp 3 with 'runSequence'. Also, I need to start reading documentation more and assuming less.

NOTE: You see the code over at Github.

The release of Gulp 4 is right around the corner, but you can already use it on the 4.0 branch. Here is why you should.