“Favor composition over inheritance”. This piece of wisdom from
Design Patterns,
one of the most influential software engineering books, is the
foundation of utility-first CSS. It also shares many principles with
functional programming: immutability, composability, predictability,
and avoidance of side-effects. The goal behind all those fancy terms
is to write code that’s easier to maintain and to scale.
While gaining traction as a symbol of Mexico City, these curious
amphibians offer hope for healing the human body, but face near
extinction in the wild.
Over the last several years, the way I write CSS has transitioned
from a very "semantic" approach to something much more like what is
often called "functional CSS."
Writing CSS this way can evoke a pretty visceral
reaction
from a lot of developers, so I'd like to explain how I got to this
point and share some of the lessons and insights I've picked up
along the way.
Functional CSS is a contentious topic, and one that regularly
generates heated comment thread debate. In such situations, it can
be tricky to tease out the hyperbole from the measured opinion.
Here’s my view on the subject, based on my recent experimentations
with the approach during a project to build a web application.
In the evening I modified the NGINX configuration for Plurrrr to
support HTTP/2 using the above article. This resulted in a
Lighthouse
mobile audit
Performance score of 100 and a Best Practices score of 100.
The low SEO score is in part caused by Plurrrr having an empty robots.txt
file. According to Lighthouse:
robots.txt is not valid Lighthouse was unable to download a robots.txt file
Here at Canonical, we use Dockerfiles on a daily basis for all our
web
projects. Something
that caught our attention recently was the amount of space that we
were using for each Docker image, and we realized that we were
installing more dependencies than we needed.
In this article, I’ll explain how we improved our image build time
and reduced the image size by using the flag --no-install-recommends
in our Dockerfiles.
Python provides very clean object oriented design syntax. With the
help of certain keywords, we can program the code by visualizing it
as real world object. This chapter will not cover all object
oriented programming concepts. However, it will teach you how to
design an object oriented program in Python.
I start by saying that this is certainly an opinion piece. However
it’s not just pure opinion. My opinion on this subject is backed by
a mathematical analysis of hashing algorithms. There are certainly
some complicating factors that may be argued to influence the
described scenario in all reality. However, given that I believe the
core logic holds, a strong argument may be made against the use of
B/S-crypt.
Sugar and spice and everything nice hold no interest for a cat. Our
feline friends are only interested in one thing: meat (except for
saving up the energy to catch it by napping, or a round of
restorative petting) This is not just because inside every domestic
tabby lurks a killer just waiting to catch a bird or torture a
mouse, it is also because cats lack the ability to taste sweetness,
unlike every other mammal examined to date.
It seems that there are two main thinking camps when it comes to the
flu shot.
Either you believe that the flu shot absolutely causes the flu
and you should never take it, or…
You believe it’s actually impossible to get the flu from the
flu shot, and that anyone who disagrees probably also thinks
the flat earth climate changed on 9/11.
As it turns out, the truth is more nuanced but still very simple.
Most of my paid work involves deploying software systems, which
means I spend a lot of time trying to answer the following
questions:
This software works on the original developer’s machine, so why
doesn’t it work on mine?
This software worked on my machine yesterday, so why doesn’t it
work today?
That’s a kind of debugging, but it’s a different kind of debugging
from normal software debugging. Normal debugging is usually about
the logic of the code, but deployment debugging is usually about the
interaction between the code and its environment. Even when the root
cause is a logic bug, the fact that the software apparently worked
on another machine means that the environment is usually involved
somehow.
So, instead of using normal debugging tools like gdb, I have another
toolset for debugging deployments. My favourite tool for “Why isn’t
this software working on this machine?” is strace.
Today I noticed that user jeffsj of
tilde.club added a link to the GitHub
repository of tumblelog to
his November 2019 link dump. The anchor text used is "A neat static
microsite generator"; thanks!
In the afternoon, when taking some fresh air, I spotted a black cat
resting on the railing of a bridge. When I petted it, it started to
move around on top of the railing. I took a photo when it was standing
still for a short moment.
I recently ran across the todo.txt format
project, which allows use to
use plain text action item lists to create and manage your
projects. I love the simplicity of the idea but there were a number
of items that prevented me from wholeheartedly adopting it.
There is no single formula for how to become an efficient remote
worker. Everyone will work at different times and have different
tips on how to make the most of their time. Indeed, one of the major
benefits of remote work is the flexibility it affords. That said,
there are a few common practices you can expect to use as a remote
worker.
This is an informational document. Although technical in nature, it
attempts to make the concepts involved understandable and applicable
in real-world situations. Because of this, some aspects of the
material are simplified or omitted, for the sake of clarity. If you
are interested in the minutia of the subject, please explore the
References and Further
Information at the end.
Why do people talk about type classes when they mean algebraic
structures? The reason is, type classes are used to implement
algebraic structures. They’re a language feature, rather than a
mathematical concept.
I've lately been tasked with migrating a classic .Net business web
API to .NET Core. One of the goals of this migration was to host the
API inside a Linux system using Docker containers. It was quite a
long and enjoyable journey. Now that it's all done, I thought I'd
share some interesting Docker bits I learned along the way.
PostgreSQL query tuning is our daily bread at
Cybertec, and once you have
done some of that, you’ll start bristling whenever you see an OR in
a query, because they are usually the cause for bad query
performance.
Of course there is a reason why there is an OR in SQL, and if you
cannot avoid it, you have to use it. But you should be aware of the
performance implications.
In this article I’ll explore “good” and “bad” ORs and what you can
do to avoid the latter.
Usually, finding a leak in Go apps is rather trivial thanks to the
built-in profiling tool that comes with Go. go tool pprof with a
minimum setup steps will show you all recent allocations and the
overview of the memory heap. Our case turned out to be a lot more
interesting.
Python is famous for allowing you to write code that’s elegant, easy
to write, and almost as easy to read as plain English. One of the
language’s most distinctive features is the list comprehension,
which you can use to create powerful functionality within a single
line of code. However, many developers struggle to fully leverage
the more advanced features of a list comprehension in Python. Some
programmers even use them too much, which can lead to code that’s
less efficient and harder to read.
If you're making any project of sufficient complexity, you'll need a
publish/subscribe
server to process events. This article will introduce you to
Postgres, explain the alternatives, and walk you through an example
use case of pub/sub and its solution.
Staticcheck is a static analysis tool for
Go code. It has various checks, such as a check for unused
variables, a check for deferring the Lock method on a mutex right
after locking (the user probably meant to defer Unlock instead), a
check for unreachable code, and more.
In this post we'll show sample code for which staticcheck returns
errors, and how to fix the affected code.
I was recently reading Martin Tournoij's Curl to shell isn't so
bad
(via), which
argues that the commonly suggested approach of using 'curl example.com/install.sh | sh' is not the security hazard that it's
often made out to be. Although it may surprise people to hear this,
I actually agree with the article's core argument. If you're going
to download and use source code (with its autoconfigure script and
'make install' and so on) or even pre-build binaries, you're already
extending quite a lot of trust to the software's authors. However, I
still don't think you should install things with curl to
shell. There are two reasons not to, one a general system management
one and one a pragmatic one about what people do in these scripts.