Personal Site & Blog of

Andrew L. Van Slaars

Code. Learn. Write. Teach.

last update:

Basic state updates in React are a breeze using setState, but updating deeply nested values in your state can get a little tricky. In this post, I’m going to show you how you can leverage lenses in Ramda to handle deep state updates in a clean and functional way. Let’s start with a simple counter component. import React from 'react'; import { render } from 'react-dom'; class App extends React.Component { constructor(props) { super(props) this.

I have great admiration for people who foster dogs (or any animal really, but I’m a dog person so that’s where my brain goes). I love dogs, so much, in fact, my wife and I have 3 of them. The thought of bringing a dog into our household, caring for it, training it and then finding another home for it is hard. I think I would have a hard time doing that (and I don’t think a 4th dog in our house would be good for anybody), but I get it.

I’ve been running my site with Hugo for a while and I initially went with the Hyde-Y theme for its simplicity and all of the baked-in functionality. All of this, along with Continuous Delivery with Codeship made this setup great for keeping things simple. Unfortunately, I’ve seen more and more issues with my Codeship setup and quite frankly, the blue and white design of the site was boring me. Inspired by the Nova color scheme, and wanting to move my hosting over to now from zeit, I decided to spend some time today applying new colors to the existing theme, making a few small tweaks, and redeploying the new site over to Zeit’s servers.

This post uses ES6 syntax. The same things can be accomplished with ES5, but it would require more verbose syntax.

I cover this in video format in my new Egghead.io course

Full Course - Build Your First Production Quality React App

The Pipe Utility Video

When writing JavaScript (or any other language for that matter), you often find yourself having to call a series of functions to get from some starting value to the desired result. To keep the examples simple, let’s use a couple of really basic functions:

My first SitePoint.com video was published today! This video is the first in a series covering the key features in hapi.js. Due to a hectic work and personal life recently, and some growing pains in coming up with a better recording and editing process, these videos have taken a while and the SitePoint team has been incredibly patient and flexible in working with me. I’m happy to have this opportunity to work with them and hope these videos are helpful to the JavaScript community.

A few days ago, my first Egghead.io video was published! “Build a Functional Pipeline with Ramda.js” shows how to use Ramda’s automatic function currying and data-last argument order to combine a series of pure functions into a left-to-right composition (pipeline) with Ramda’s pipe function. I’m incredibly excited that I have the opportunity to be a part of the community of Egghead.io instructors. I’m anxiously awaiting some upgraded sound gear so I can record better audio.

The Not Todo List

As I write this, I am a few short weeks into being a father to a beautiful baby girl. I knew going into this that my free time and sleep would be limited, but I don’t think I was as prepared as I could have been. Aside from normal work and home responsibilities, I had several extracurricular projects in the works leading up to my daughter’s birth. The part of my brain that likes to underestimate and over commit fooled me into believing that I would magically be able to keep all the balls in the air and I would just complete things at a slower pace.

How I use git to give better code presentations

I originally posted this on medium. The basic idea is the same, but I have done quite a bit of editing and added some content.

For years, I would live code while teaching development classes. The mistakes I made (and there were plenty) would lead to ad-hoc lessons on debugging, and that was a good thing. I had the advantage of time and being in an interactive classroom environment, was able to turn these mistakes into lessons. I built enough time into my lesson plans to account for the live coding, and the subsequent debugging, questions, and conversations that came with it.

I like writing code and building applications, but I’d like to focus those efforts on new and interesting projects, not on building and maintaining yet another blogging engine. So, when I started this blog, I decided to go with a static site generator. I am using Hugo, and after about six months, I am very happy with that decision. One of the things I knew when I started this blog, was that if publishing were to become too cumbersome or time consuming, I would be even less likely to write on a regular basis - publishing regularly is hard enough for me without my tools getting in the way.