Guzzle: Fake a Response using a `MockHandler`

Now this will come in handy for testing: ⚗️ One of the most common integrations developers struggle to test is Guzzle. Fortunately, it has a `MockHandler` you can set up to return predefined responses. Since it uses the existing `Client` and `Response` objects, there's no need to change your implementation. — Jason McCreary (@gonedark) December …

JavaScript: var vs let vs const

Nice Doodle by Abhishek Kumar explaining the difference between JavaScript’s var, let, and const: Good to see hoisting is also explicitly mentioned by name. 💁‍♂️ I personally always start with const. Only if I need to reassign a variable’s value (for example: a counter in a loop) I use let. I see no good reason …

ESNext: Replace all occurrences of a piece of text in a string with String.prototype.replaceAll

UPDATE June 2020: This feature has advanced to Stage-4 and will be part of the ES2021 Specification! 🎉 An ECMAScript Language feature that’s currently in Stage-3 is String.prototype.replaceAll, a handy way to replace all instances of a piece of text in a string. ~ The Problem If you ever needed to replace a piece of …

Andy Budd: 11 things I know to be true

Photo of the Clearleft offices. Andy Budd, part of Clearleft, shares some things he has come to believe over the years: You are not your user It’s often easier to break big problems down into smaller problems Sometimes you need to slow down to speed up Design can provide a huge amount of value to …

JavaScript File Format Differences: The difference between Generic JavaScript, JavaScript Modules, and CommonJS Modules

There’s the pervarsive notion that all JS is created equal and that there’s only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view. Very resourceful Gist which highlights the key differences between Generic JavaScript, JavaScript Modules, and CommonJS Modules! Take the …

How tracking pixels work

Julia Evans: I spent some time talking to a reporter yesterday about how advertisers track people on the internet. We had a really fun time looking at Firefox’s developer tools together (I’m not an internet privacy expert, but I do know how to use the network tab in developer tools!) and I learned a few …

Fundamentals of Hierarchy in Interface Design

Visual hierarchy is the order in which the user process information by importance. In interface design, like in any other form of design, this concept is necessary to be functional at sight. With the correct use of hierarchy, the mind can group and prioritize elements to give them a specific order, which facilitates the understanding …

Understanding positioning in CSS

Chen Hui Jing: Everything on the web is a box. The positioning algorithms used to calculate the position of a box on the page is determined by the position and float properties. I’ll try my best to explain this in a way that makes sense. But first, let’s look at them individually. Good introductory post …