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.
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:
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…
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.
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…
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:
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…
false == 0 //true
false == '0' //true
false == '' //true
false ==  //true
false == [] //true
false ==  //true
false == 000 //true
false == '000' //true
false == false //true
false == null //false
false == undefined…
Apple’s recent TLS bug highlights once again the dangers of writing single-line if statements.
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…