You’re probably aware of the comma separator in CSS selectors. They’re a handy way to have a set of CSS attributes applied via multiple selectors in one go.

You’re probably also aware of pseudo-classes (sometimes referred to as pseudo-selectors). They give your selector some smarts. For example “input:focus” applies only when the input element has focus.

I recently ran into a problem when I used both at the same time. The site I work on has a menu that is meant to only be scrollable when the mouse is over it (to hide the scrollbar). …

Anyone who’s developed front-end applications knows that managing the state is one of the most important, and challenging, aspects. Popular component-based view libraries, like React, include fully functional, if not rudimentary, state management. They enable each component of your application to manage their own state. They work well enough for small applications, but you’ll quickly encounter frustration. It’s a challenge deciding which components have state and how the data from each state gets shared between components. Then there’s figuring out how or why state was changed.

To address the above problems of component-oriented state, libraries like Redux were introduced. They…

It’s commonly agreed that engineering interviews are broken, and yet they never change. Why are they broken and how can they be fixed?

The standard software engineering interview often includes the following:

  • Solve some “algorithmic” question on a whiteboard or in CoderPad.
  • Answer trivia questions about the technologies they are expected to work with.
  • Describe a bug and how it was fixed.

We do these because they supposedly tell us something about the candidate we’re interviewing. They’re supposed to tell us if the candidate is “capable” or “incapable”.

Algorithmic questions as simple as FizzBuzz are supposed to tell us whether…

Help businesses bring back jobs and create new ones by refunding some of the salary

Jobs are threatened like never before. Whether it’s automation or globalization, we need a solution.

People want to work

We’re quickly headed for a world with more people that want jobs than there are jobs available. In order to avoid extreme levels of poverty, some argue for a universal basic income (UBI), a living wage paid to all citizens, whether they are working or not. This would take care of people’s biological needs: food and shelter. I’m a fan of UBI, but most people aren’t ready for it yet. People still want jobs.

Politicians love to talk about jobs, and that’s for a reason…

If you’ve been making web apps with Rails for long enough, you will have encountered ActiveRecord’s handy find_each method. It iterates over a bunch of records, loading only 1000 at a time, which allows you to avoid running out of memory. Pretty handy if you need to do something to all 1 million of your User records!

When you use find_each, you probably just pass it a block like so:

That’s well and good if you want to do something to each user. But what if you need to find that one particular user out of a million that…

Browser makers have been giving us web developers lots of great new tools lately. Whether it’s variables in CSS or new JavaScript language features, it can be hard to keep up. One lesser known new browser feature is known as the ECMAScript Internationalization API. It exposes info to JavaScript like a user’s locale, 24hr vs 12hr time format, time zone, and more. Accessing the user’s time zone directly sounds great… right?

This is a story of how it caused a nasty bug.

I work at Hired as a software engineer. Hired is an app that helps people get jobs. One…

Neutrality for some, but not for all.

We’re finally at the point where the public is fighting for their right to unrestricted Internet access. It’s starting to look like net neutrality might become a “thing” in the US, maybe.

This has been in large part due to grassroot activists getting the word out, John Oliver, and the support of tech companies that are directly affected and willing to speak out (e.g. Netflix, and Reddit). Also included is Twitter:

“We support the Internet Slowdown campaign and its efforts to draw public attention to a critically important issue. We’re not planning…

I recently signed up with Digital Ocean on their $5/month plan to rent an instance (aka droplet) for the purpose of hosting a couple web sites. I’ve heard good things about them and the price and specs were right.

For the past two weeks I’ve been rather pleased with the product. It has a great UI and my instance seemed to be performing just fine, that is, until this morning.

Today I woke up to discover that my sites were down and I couldn’t ssh into my instance. I first assumed I must’ve done something wrong to my instance the…

How == works in JavaScript

false == wat?

I came across an interesting blog post the other day laying out the results from comparing false in JavaScript to various values using ==. The results were rather interesting but the author didn’t explain the odd results. I recommend checking out the post I linked to above, but I’ll copy and paste the list of comparisons here and then explain why JavaScript produces these seemingly odd results:

false == 0 //true
false == '0' //true
false == '' //true
false == [] //true
false == [[]] //true
false == [0] //true
false == 000 //true
false == '000' //true
false == false //true
false == null //false
false == undefined…

How to avoid problems without totally avoiding them.

Apple’s recent TLS bug highlights once again the dangers of writing single-line if statements.

Apple’s bug was caused by a common feature of C and languages that inherited its syntax (e.g. C++, Java, and JavaScript); the option to not use curly braces when only one statement is guarded by the if statement.

The above two ‘if’ statements behave the same in C-like languages.

It’s very tempting to make use of this feature since it saves at least two characters (the curly braces) and usually a newline or two. But as we see in the Apple bug, if one were to accidentally attempt to add a second statement to the if block…

Jon Abrams

Canadian Software Engineer in California

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