Photo by EJ Yao on Unsplash

Recently I’ve been working on understanding more Javascript fundamentals and I took a look at hoisting. I thought that it was a pretty cool concept, so have written a blog post explaining it.

What is hoisting?

Hoisting is a process in the Javascript engine which does a pass through your code and allocates memory based on the presence of certain things. Hoisting is a way for us to understand how this works.

In the Global Execution Context, there are two stages, the creation stage, and the execution stage. The former provides the Global Object (e.g. ‘Window’ in the browser), the this keyword, and…

For a fun challenge, I started learning a little bit of AI and Machine Learning. I’ve been studying the excellent Fast.AI course. This is a series of videos which takes you from zero to hero with Machine Learning for free.

As part of my learning process, I wanted to use my own dataset. I took a few days to choose a problem but my criteria were:

  • A freely available dataset
  • Could be used for social good
  • Not overly complex for my first attempt

So after scouring Kaggle and the internet in general for a cool dataset, I stumbled upon a…

Photo by Fancycrave on Unsplash

String reversal is a very common interview question, and luckily it’s quite simple. There are many different ways to do this, but here are four methods, starting from the simplest and going to the most complex.

Use arrays

This is a very straightforward method that leverages existing language features in order to accomplish a task. Most interviewers would ask you to perform the same task in a more ‘manual’ way if you tried this, but it demonstrates an awareness of Javascript, and is what I’d use in real life to accomplish this.

Javascript allows you to call the reverse method on arrays…

Photo by apoorv mittal on Unsplash

Big O Notation allows us to measure the time and space complexity of our code.

Think of the example of a for loop. You can run it over an array of 5 items and it will run pretty quickly, but if you ran it over an array of 10,000 items then the execution time will be much slower. See an example:

Big O notation allows us to work out how long an algorithm will take to run. This lets us understand how a piece of code will scale. It measures algorithmic efficiency.


This is known as constant time…

Photo by Felix Russell-Saw on Unsplash

As a developer, I often find that I need to set up servers for client work. In the past this used to be a painstaking process, but thanks to Digital Ocean and AWS, it has never been easier!

A common requirement is to create an FTP server — so I’ll show you how to quickly do this with AWS.

Step One

First, go to your AWS console and create an EC2 instance. You will find this under the ‘Compute’ category. I personally chose all the default settings and created a t2.micro instance running Amazon Linux AMI.

For the security group I chose…

We are all attached to the things that we create. From our relationships, to our work, to trivial things like the way we decorate our home — we don’t like to destroy things that we have put effort into.

That’s why it’s even more important to delete your code.

When working on a project recently, I had put several hours into creating the application logic, crafting the code with care, and feeling quite pleased with myself. …

A handy way to remember…

Full disclosure: this was created by ‘Snapey’ on the Laracasts forum. I thought it was useful and put it on my blog to make it easy for me and others to find.

A lot of people, including me, become very confused when it comes to remembering how to structure eloquent relationships and which relationship gets a foreign key (if at all).

The table below is an easy summary of how it works and is useful for a quick jog of the memory:

I’ve been playing around with React and Redux recently and thought I would start writing articles on concepts which I’ve had to wrap my head around.

So unless you’ve been living in a cave for the past few years, you’ll know that React is an awesome front-end library developed by the good folks at Facebook to make life easier for developers.

It’s different to Angular or other frameworks as it is purely front-end (though see the comments below for a great clarification on this). With that said, it’s extremely powerful.

One of the concepts I struggled to understand during my…

This article examines the concept of blockchains and how they could be utilised by law firms.

Most people at this stage will have heard of Bitcoin — classified by the US Treasury as a decentralised virtual currency. Launched in 2009, it is the focus of a huge amount of investment with $1BN predicted to be invested by the end of 2015.

Whilst Bitcoin is a fascinating topic, and I encourage whoever reads this to look into it further, the really exciting topic is the technology behind Bitcoin — the Blockchain.

The technology blog Re/code provided an excellent analogy for the…

How they work and a quick PHP tutorial

What are webhooks?

Webhooks are ‘user-defined HTTP callbacks’. When an event occurs, the originating site will send an HTTP post request to a (usually) third-party who can then do something with it.

As an example, if you pay for something with Stripe then it will send a webhook. This will contain lots of data that looks like this:

Stripe\Charge JSON: {
"id": "ch_15qP2a2eZvKYlo2C4fpk2mXl",
"object": "charge",
"created": 1428760376,
"livemode": false,
"paid": true,
"status": "succeeded",
"amount": 4995,
"currency": "usd",
"refunded": false,
....and so on

You can check out a more complete version on Stripe’s API docs here.

Why should I care?

Ruairidh Wynne-McHardy

Senior Developer. Powered by coffee.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store