Tag descriptor

Coffee and Oranges

An article, posted about one month ago .

End of 2018 I started a separate blog. Coffee and orange. I decided to move all content back to my main blog, because I didn't want to keep on maintaining a Wordpress instance. This site is happily served by my own system. Below are the just 5 posts. I happily continue to post new items on my blog.

Continue reading...

Relative font sizes, or pixel based? 2020-edition

An article, posted 4 months ago filed in , , , , , , & .

Occasionally I still have discussions about px-based font sizing, feeling like the other party has lived under a rock since early 2000's. But some designers still like their pixel based tools; maybe it even got popularised again by relatively new tools like Sketch and Figma, introducing pixel-units in a vector-based tool.

Well, to be honest, it matters less these days when compared to the days I learned that pixels are bad. Those days browsers were enlarging only text when it used relative sizes. In response to not all sites serving relative font siz browsers have introduced full page zoom functions, which is common place these days, when you press Command/Control plus ‘+’ everything will scale; text images etc.

But the text-size function is still used. In Firefox, Settings > General > Language and appearance sets the default font-size. In Chrome: Settings > Appearance > Lettersize. When you’re young and able you probably wouldn’t need to know about these things. But we shoul…

Continue reading...

Nieuwjaarsrede 2020: Introspectie

Weer verhuist. Hopelijk blijft het zo. Een prachtige plek in Amsterdam voor mij, mijn vriendin en onze dochter. In een nog redelijk gemengde wijk, maar voor ons zaten er arbeidsmigranten met een westerse achtergrond dus euh :) #gentrificatie

Ik zit in een luxe positie. Een huis kunnen kopen in Amsterdam is al een luxe op zich. Toch voel ik mij nog steeds verwant met de linkse kant van het politieke spectrum. Alleen schijnt dat niet bij iedereen een populaire positie te zijn. De linkse politiek is het afgelopen jaar een gewild doelwit geworden van een uitdijende groep. FvD’ers, Nazi’s, Boeren, VVD’ers. En dat wringt toch ergens, want links ben je in de eerste plaats toch vooral omdat je betrokken bent, bij mensen die het financieel minder hebben, bij het milieu en het klimaat, bij gediscrimineerde minderheden. En het idee is dus dat die mensen, dieren, planten, planeet, geholpen dienen te worden vanuit de overheid (want democratisch en onpartijdig), iets dat (eenvoudig gezegd) het…

Continue reading...

How to REST?

An article, posted 7 months ago filed in , , , , , , , , & .

Today I tried to explain REST (as in REpresentational State Transfer, not near sleep) to a manager and why some of the services deployed at the organization he was working for wasn't REST. While there isn't a formalized spec, there is a dissertation by the Roy Fielding, who came up with the REST-principles as a set of principles that guided him while shaping the HTTP 1.1 standard which only recently got a successor with version 2.0… REST is a set of principles/guidelines that are very stable & predictable. It is also very simple, and theirin lies both its strength, and the sometimes too loose application of its principles.

Apparently many developers didn't get 'the web' (HTTP) right, hence REST was developed as a basic set of principles to explain how HTTP is supposed to work. This is a list of my favourite parts, also based on some secondary resources.

Some key concepts.

REST is about …

Continue reading...

Considering online generation of certificate requests

An article, posted 9 months ago filed in , , , & .

Recently I’ve been researching what other Certificate Authorities do within the domain of online generation of certificate requests (and related private keys).

It is tricky territory: JavaScript and Crypto. Or more generic, webapplications and crypto. But with the advance of the WebCryptoAPI some issues that were raised (e.g. insufficient random number generation) by security experts have been addressed, but still: the WebCryptoAPI entry on MDN starts with a fair warning: “If you're not sure you know what you are doing, you probably shouldn't be using this API.”

Why think about a web implementation at all to create a certificate request? Typically tools to generate certificates are hard to use. Just look at the list of options a user has to generate certificates, which are typically all of…

Continue reading...

Total cost of ownership valt niet te generaliseren

An article, posted 10 months ago filed in , , , , , & .

Om de zoveel tijd komt de term weer terug: 'TCO'. Total Cost of Ownership. Hoeveel het allemaal bij elkaar kost. Het werd in het verleden ondermeer uit de kast gehaald door Microsoft om te waarschuwen voor de kosten die de conversie van naar opensource software met zich mee zouden brengen. Onder TCO wordt dan ook gekeken naar o.a. opleiding, de kosten van licenties, wat de onderhoudsmedewerkers kosten (linux beheerders zouden duurder zijn dan mensen met een microsoft diploma). Wat willekeurige observaties.

Jaren terug genoteerd:

> Grappig om te zien hoe hij met het bijna niets kostende stukje software (van een grote speler) vele uren bezig is om via de complexe interface iets relatiefs simpels voor elkaar te krijgen: een factuur te printen. Straks gaat het zich terugbetalen, zo gaat het argument… maar ik heb er weinig vertrouwen in. Niet in dit geval. Wanneer je werkt met relatief grote bedragen worden er niet zoveel facturen verstuurd. Automatische koppelingen met de bank is …

Continue reading...

Meerdere wegen naar Rome

An article, posted 12 months ago filed in , , , , & .

Niet alle offerteaanvragen waarop ik reageer gaan goed. Onlangs kreeg ik een reactie terug dat ik iets niet geoffreerd had. En dat klopte, ik had een alternatief geoffreerd. Toegeven, ik was eigenwijs. Ik had het naar mijn idee redelijk beargumenteerd, en wat mensen die ik had laten meelezen waren erg enthousiast: een boekhoudsysteem ga je niet opnieuw bouwen.

Het was naar mijn mening niet slim om wijdverspreide functionaliteit vanuit het niets opnieuw te bouwen (je bouwt immers ook geen mailinglijst software vanuit het niets, niet? 🤦‍♂️).

Er zijn meerdere wegen naar Rome. En als de klant een route heeft gevonden, wie ben jij dan om daar als leverancier ineens vanaf te wijken? Probleem was immers ook dat klanten van die klant al eigen keuzes hadden gemaakt voor verschillende boekhoudpakketten, die er toch al naast gebruikt werden. En om met al die pakketten diep te integreren zou toch wel eens lastig kunnen worden. Ik dach…

Continue reading...

TL/DW: .css_day#ui-special

An article, posted 12 months ago filed in , , , , , , , , , , , , , & .

Yesterday I attended the CSS Day conference. This year only the first day, that focussed on designing user interfaces, less the building of it. Here are the key take aways for those who thought going through all slides is too long, or didn’t went.

Josh Clark - A.I. is your New Design Material

Josh urged designers to get feeling for the new design material called AI, the next big thing. We need to know what makes it different, the grain, and also know how we can use it for good. Design might have a seat at the board table, but they need to know how to align user considerations with business goals. More on AI and design by Josh Clark and more.

Steph Troeth - Behind the story

Storytelling used to be all the rage before mobile entered the scene, Steph recalls. Nevertheless, people prefer stories over plain lists of…

Continue reading...

Using your ruby-webmock configuration for your local test service

An article, posted about one year ago filed in , , , , , , , & .

I recently shared an overview article about Stubbing External Services in Rails. I found it when looking for the best way to stub a pletora of services in a microservices environment. Sure, docker (or whatever) everything and run it locally / in your test suite. But unless you've plenty of disk- and memory space, this isn't always a viable option. The alternative: simulate the service. Mock or stub the endpoint.

VCR and Webmock

The go to gems are Webmock, which catches request and allows you to define the responses explicitly and VCR, which allows you to record responses, and play back.

VCR is quite cool, but as it is a recorder of earlier responses, there may be a lot of noise to dig trough when trying to make the responses a bit more generic (dealing with random token requests and what else)

For testing I pers…

Continue reading...

Tag descriptor

Programmeren leren

An article, posted about one year ago filed in & .

Wil je beginnen met leren? Hieronder een reeks links voor opties in verschillende programmeertalen.

Continue reading...

De eerste vier zaken op een (macOS) ontwikkelmachine voor beginners

An article, posted about one year ago filed in , , , , , , , , , , & .
  1. Update eerst naar de laatste versie van ’t OS, Mojave. Je kunt deze gratis downloaden in de App store, zie upgrade instructies voor Mojave.
  2. Installeer homebrew … macOS Terminal (zeg maar de Command Prompt van de Mac) vind je door Cmd+Spatie in te drukken en vervolgens "Terminal" te zoeken (meestal vind je die al na de eerste paar letters). Vervolgens de regel invoeren (kopiëren & plakken) die de website vermeld. Soms moet je extra dingen installeren; het script zal je daar doorheen leiden. Overigens, dat commando, Cmd+Spatie, opent wat Spotlight heet, ik vind dat de gemakkelijkste manier om programma’s te starten.
  3. Install Docker for mac (je hebt hier tegenwoordig helaas een account bij DockerHub voor nodig). Dit download een DiskImage, sleep het programma naar de programma’s map (zoals het image waarschijnlijk ook al aangeeft in de achterg…

Continue reading...

Bad CSS in JS

An article, posted about one year ago filed in , , , , , , , , & .

I tried to understand the argument made for styled components vs. ‘traditional’ CSS. But when reviewing these arguments I found out that they typically use bad code as proof for their point.

See e.g. the following SCSS code:

$blue = #5DBCD2;

@mixin button-styles($bg-color, $color) {
  background: $bg-color;
  color: $color;
  border: none;
  border-radius: 0.20em;
      background: darken($bg-color, 6%);
      cursor: pointer;

.button {
  @include button-styles(#ddd, black)

.button--primary {
  @include button-styles($blue, white)

To pair with a simple component along the lines of:

const Buttons = props => (
export default Buttons

The suggested alternative is:

import themeVars from "myTheme"
import styled from "styled-components"
import { darken } from "polished"

const B...

Continue reading...

Global variables in Rails

An article, posted about one year ago filed in , , & .

A quick note, because I was using the wrong search terms. If you want to share e.g. the current user of an app with a model you can now (since Rails 5.2) use a model inheriting from ActiveSupport::CurrentAttributes. Before you were required to pass this current user explicitly or find another way to access state.

Note that this can either be a good thing or a bad thing (tl;dr: thread-local global state makes apps unpredictable)

And even the docs warn against abusing this feature. Powerful tools can come with dangerous consequences :) Global variables are immensely powerful. Use with care. I'm not even sure if I'm going down this path…

Continue reading...

Revisiting taming ruby's memory bloat meta-edition

An article, posted about one year ago filed in , , , , & .

There are a lot of things that I don't understand. One of these things is how memory management really works. Memory management is hard, and even though I use languages that do garbage collecting by themselves, long running ruby apps seem to run out of memory after n number of days. Even the pro’s find it quite hard. While I previously resetted the failing app every now and then, I was triggered by Mike Perham’s (creator of Sidekiq) post: “Taming Rails memory bloat”.

When you start searching for the memory bloat problem, you'll find several directions. The easiest is changing a global variable which changes the number of “arena’s” where memory allocation takes place (note: I’m in no position to explain all this, please follow the references). The fanciest, however, seems to be changing the memory allocator from glibc's default 'malloc' to jemalloc. See for example [this](https://www.speedshop.co/2017/12/04/malloc…

Continue reading...

Lazy loading the lazy way

An article, posted more than one year ago filed in , , , , & .

Below is a simple, lazy, technique I applied in a collection management tool where its users wanted to browse over 10.000 images without scroll-hijacking or pagination. Sure, only the HTML weight several MB’s at once, but for this particular application used by professionals it is worth the weight. But performance was too heavily affected by downloading all these separate images.

So let’s have a look how I solved this.

What does the code below do?

You rightly guessed that it won’t display any image to say ~95% of the users. The 5% who have disabled Javascript however, will see it.

The 95% who do have Javascript can enjoy the image simply by moving the img tag out of the noscript tag using a bit of JavaScript:

ELEMENTS_QUERY = "noscript[data-lazy=\"lazy-load\"]"

decode_entities = (encodedString)->
   ## required for IE and Safari
   textArea = document.createElement('textarea')

Continue reading...

murb blog