Writing Go applications in an isolated environment with Docker comes
with some great advantages. You get the bare essentials for
developing, and you can easily change which Go version you’re
developing against.
In this tutorial, we’re going to show you how to structure a Go
application with Docker Compose as your development environment.
In the end you'll have:
A docker compose setup to develop in
An HTTP server written in Go that is connected to Postgres
An auto-reloading server that compiles when you change a file
Mark functions as async. Call them with await. All of a sudden,
your program becomes asynchronous – it can do useful things while it
waits for other things, such as I/O operations, to complete.
On the surface it seems fairly easy to create a masonry layout with
flexbox;
all you need to do is set flex-flow to column wrap and voilà,
you have a masonry layout. Sort of. The problem with this approach
is that it produces a grid with a seemingly shuffled and obscure
order. Items will be (unbeknownst to the user) rendered from top to
bottom and someone parsing the grid from left to right will read the
boxes in a somewhat arbitrary order, for example 1, 3, 6, 2, 4, 7,
8, 5, and so on so forth.
Amahle is a Light Chaser – one of a number of explorers, who travel
the universe alone (except for their onboard AI), trading trinkets
for life stories.
But when she listens to the stories sent down through the ages she
hears the same voice talking directly to her from different times
and on different worlds. She comes to understand that something
terrible is happening, and only she is in a position to do anything
about it.
And it will cost everything to put it right.
In the evening I started in Light
Chaser
by Peter F. Hamilton and Gareth L. Powell.
A friend of mine recently
pointed me at a well hidden command line tool. In the JavaScript
framework used by Safari and other parts of Apple’s products, there
is a tool called jsc. It’s a command line interface for JavaScript
that uses the same code as the rest of the system.
Several years ago I started writing a series of
posts on plugins: how
they are designed and implemented in various systems and programming
languages. In this, I'll extend the series by providing some
examples of plugins in Go.
As a reminder, the original
post
in this series identifies four fundamental plugin concepts, and
claims that nearly all plugin systems can be characterized and
understood by mapping their design to these concepts:
Discovery
Registration
Application hooks to which plugins attach (aka. "mount points")
Exposing application capabilities back to plugins (aka. extension API)
Programming with exceptions is difficult and inelegant. Learn how to
handle errors better by representing them as values.
In Smelly
Exceptions, I
laid out 3 practices to avoid when programming with exceptions. My
goal there was to help you write more maintainable code. We saw that
misuse of exceptions make programs brittle, tightly coupled, and
difficult to reason about. The common factor in all three
anti-patterns we discussed was exceptions. They are hard to use
correctly. Even when used correctly, they don't compose, so the
program flow is unnatural. In short, they are exceptions.
Board the Millennium Falcon and journey to a galaxy far, far away in
an epic action-adventure that will set the course of one of the Star
Wars saga's most unlikely heroes.
In the evening Adam, Esme, and I watched Solo: A Star Wars
Story. I liked the movie and
give it a 7.5 out of 10.
This tutorial is not a complete guide to redirection, it will not
cover here docs, here strings, name pipes etc… I just hope it'll
help you to understand what things like 3>&2, 2>&1 or 1>&3-
do.
Since version 3.5, Python now has support for type
hints. This typing
is a cool new feature allowing type checking across your code for
more quality and also help when you are using some packages or call
some functions your colleague did in a large codebase. In this
article, we will see how to enable type IntelliSense and type
checking analysis in Visual Studio Code editor.
We love to use model images at Wehkamp. This year we've switched
from overviews with product images to overviews with model images. A
lot of photography is shot by our own photo studio. I love this,
because it gives us control over the process and the tone. But as
our assortment grows, it is not feasible to shoot all the products
on our website. That is why we use images from our
suppliers. Unfortunately, we have no control over the conditions of
the photo.
In the evening I finished The Blinding
Knife,
Book 2 of Lightbringer series by Brent Weeks. I liked the book a lot;
packed with action. I consider the book better than the first one. A
recommended read.
For whatever reason, the alpine-glibc
project is
apparently being used in
production.
Worse yet, some are led to believe that Alpine officially supports
or at least approves of its usage. For the reasons I am about to
outline, we don’t.
Using async Rust libraries is usually easy. It's just like using
normal Rust code, with a little async or .await here and
there. But writing your own async libraries can be hard. The first
time I tried this, I got really confused by arcane, esoteric syntax
like T: ?Unpin and Pin<&mut Self>. I had never seen these types
before, and I didn't understand what they were doing. Now that I
understand them, I've written the explainer I wish I could have read
back then. In this post, we're gonna learn
Wondering how to build a website crawler and parser at scale?
Implement a project to crawl, scrape, extract content, and store it
at scale in a distributed and fault-tolerant manner. We will take
all the knowledge from previous posts and combine it.
This post is an account of why I prefer using the attrs library over
Pydantic. I'm writing it since I am often asked this question and I
want to have something concrete to link to. This is not meant to be
an objective comparison of attrs and Pydantic; I'm not interested in
comparing bullet points of features, nor can I be unbiased since I'm
a major contributor to attrs (at time of writing, second by commit
count, after Hynek) and the author of one of its unofficial
companion libraries,
cattrs.
In this guide, we'll be using borb - a
Python library dedicated to reading, manipulating and generating PDF
documents. It offers both a low-level model (allowing you access to
the exact coordinates and layout if you choose to use those) and a
high-level model (where you can delegate the precise calculations of
margins, positions, etc to a layout manager).
We'll take a look at how to create a PDF invoice in Python using borb.
I remember the sad day that I finally gave up on using Emacs for
Java development at work. I had spent hours trying to configure it
to properly index all of the files so that I could go to definition
easily. My mentor, the old Lisp guy with the insane init.el file who
I would pester with questions, told me: “Just use IntelliJ”.
Iterators are part of Rust’s secret sauce. They power things from
the humble for-loop to the elegant iterator chain, but have you ever
stopped to think how they work?
Let’s find out more about Rust’s iterators by implementing our own
versions of common iterators and reading the standard library’s
source code.
New in Swift 5.5: It’s now possible to define protoddcol APIs that
let us use Swift’s very convenient “dot syntax” to create conforming
instances, which in turn can make certain protocols act more like
enums, while still retaining all of the flexibility that protocols
give us.
Jakob Nielsen's 10 general principles for interaction design. They
are called "heuristics" because they are broad rules of thumb and
not specific usability guidelines.