Using Refs in React

As of React 16.3 there will be a new way to create "refs" (references to the actual underlying DOM element). Below we'll go over each one and talk about its pros and cons. To learn all about Refs from the React documentation, it's available here. String Refs (deprecated) This is an "older" way...

In Frontend (React, Javascript) By Leigh Halliday February 25, 2018

Leigh Halliday

React Fundamentals & Beyond

I'm excited to announce that I'll be running a 2 day (weekend) workshop on React! It's called React Fundamentals & Beyond because we'll be starting with the basics, but then learning some cool things like: ES6/ES7 JSX AJAX with Axios Styled Components React Router MobX (state management) Re...

In Frontend (React, Javascript) By Leigh Halliday February 23, 2018

Leigh Halliday

Introduction to MobX State Tree

MobX State Tree takes something which is awesome (MobX) and brings it to the next level. You can now define your own typed models, made up of typed fields, and have them all nested together in a tree. You still get all of the same beautifully hidden immutability that comes with MobX, and the lack...

In Frontend (React, Javascript) By Leigh Halliday February 19, 2018

Leigh Halliday

MobX in Create React App Without Ejecting

You do not have to eject from create-react-app to get support for decorators and other babel plugins. MobX works fantastic with decorators and I've always been ejecting to get that working... but there is no longer a need to do that! In this video we'll take a look at how we can get MobX working...

In Frontend (React, Javascript) By Leigh Halliday February 09, 2018

Leigh Halliday

Converting Callbacks to Async/Await

Async/Await makes working with callbacks seem like ancient history, but you'll still encounter callbacks as you work with older libraries and certain browser APIs which haven't yet been converted. In the article and video I'm linking to below, I'll show how to convert the geolocation.getCurrentPo...

In Frontend (React, Javascript) By Leigh Halliday February 05, 2018

Leigh Halliday

Create React App with MobX using Decorators

Create React App is a great way to get up and running with React. It comes configured with sane defaults which are great for most people, but unfortunately we'll need to make a few changes before we can use MobX. I'm a huge fan of MobX and it's been my go-to state management tool for the differe...

In Frontend (React, Javascript) By Leigh Halliday October 24, 2017

Leigh Halliday

Introduction to Mobx and React

In this video tutorial I show how to get up and running with Mobx in a React app. We will go from create-react-app all that way to having a fully functioning Mobx store connected to our components. If you would like to follow along, you will need: Node (recent version): https://nodejs.org/en/ ...

In Frontend (React, Javascript) By Leigh Halliday July 14, 2017

Leigh Halliday

Named Captures in Ruby Regular Expressions

In Ruby we can use the match method which belongs to the String class to both check a string for a regular expression match but also to extract data using captures. Captures allow you to extract part of the string... to isolate it. You do this by including () parentheses, with whatever that is i...

In Ruby On Rails By Leigh Halliday September 01, 2016

Leigh Halliday

Building a CLI in Ruby with GLI

Typically in Rails apps we use rake tasks as a way to interact with our application through the command line. We're all familiar with running code like rake db:migrate, or custom rake tasks that we create ourselves. There is another way to create CLI programs in Ruby with a very nice interface, ...

In Ruby On Rails By Leigh Halliday January 28, 2016

Leigh Halliday

Skinny controllers through refactoring

Controllers can get out of control. Their job should generally be quite simple. In an MVC framework such as Rails, they should have the job of knowing how to work with the Model in order to get what is needed for the View. In other words, they receive the user input (through params) and determine...

In Ruby On Rails By Leigh Halliday January 19, 2016

Leigh Halliday

Ruby web frameworks which aren't Rails: Cuba, Sinatra, Padrino and Lotus

It’s common for a Ruby developer to describe themselves as a Rails developer. It’s also common for someone’s entire Ruby experience to be through Rails. Rails began in 2003 by David Heinemeier Hansson, quickly becoming the most popular web framework and also serving as an introduction to Ruby for...

In Ruby On Rails By Leigh Halliday December 15, 2015

Leigh Halliday

Jbuilder to AMS - A tested journey

Not everyone is creating a new Rails app from scratch. Most of us have existing ones which may use RABL, Jbuilder, or a number of other options to generate JSON responses. When we're refactoring large and important parts of our app, how can we test to ensure that refactoring doesn't change the ap...

In Ruby On Rails By Leigh Halliday November 30, 2015

Leigh Halliday

Is it nil?

What is actually happening under the covers in Ruby when you ask if a variable is nil? It turns out that it's way simpler than you may think, and it all comes down to object oriented programming and inheritance. You've probably heard it said that everything in Ruby is an object... this includes ...

In Ruby On Rails By Leigh Halliday November 25, 2015

Leigh Halliday

Storing JSON in Postgres

Should you use a Document (JSON) or Relational database to power your website? With Postgres you don't need to choose between them... the answer is to use both! Postgres 9.4 comes with amazing JSON support which gives you the best of both worlds. This article also explores how to use this new functionality from within Rails.

In Databases By Leigh Halliday November 22, 2015

Leigh Halliday

Understanding method missing

In this article we look at how method_missing and respond_to_missing? work by looking at the StringInquirer class of Ruby on Rails.

In Ruby On Rails By Leigh Halliday September 08, 2015

Leigh Halliday

Frontend (React, Javascript)

category-image

Software Development

category-image

Ruby On Rails

category-image

Databases

category-image

Elixir

category-image