Working efficiently with GraphQL-CodeGen types in TypeScript

In our project, we’re using GraphQL, and we’re using graphql-codegen to generate types for our queries. While this is very convenient, it’s almost impossible to extract sub-types from these generated types. Let me explain.

Weiterlesen

Audit Events in your GraphQL Stack with the postgraphile-audit-plugin

In many projects, one needs to track changes in data in your database. With pgMemento, you can automatically generate audit information like that. It extends your PostgreSQL tables by an audit_id column, which in turn refers to the specific audit event in the pgMemento tables, which are by default stored in a separate database schema.

So far, so good.

Weiterlesen

Creativity, curiosity, craziness – the real superpowers of human cooperation

Following philosopher Yuval-Noha Harari, cooperation is the key to our human being and what humans achieved in evolution, making us humans more successful than other creatures on earth. „It is the unprecedented ability to cooperate flexibly in large numbers“ that makes us unique. No other creature on earth can cooperate in a way like this, ants and bees, f.e. also cooperate, but in a very rigid way or only close relatives. So you can’t compare an ant workforce and their cooperation with humans. 

Interactions with strangers and building new social cooperation networks in such an effective way is a human privilege.

Weiterlesen

RoadRunner – High-Speed PHP Applications

PHP is sooo yesterday. It’s slow. It’s not hip. Don’t use it. 

That’s what people say.

Well, people, listen up! Because RoadRunner has come to pimp PHP performance in astounding dimensions. So let’s take a look at what RoadRunner is.

Weiterlesen

LSH – an efficient approach to nearest neighbour search

In Image similarity search with LIRE we explained how to compare and find similar images using the Java library LIRE. The idea was to transform the complicated problem of comparing a large bunch of pixels to the simpler problem of comparing vectors representing histograms and other higher-level properties. In other words, if we can compress the information inherent in a bunch of pixels to a point in n-dimensional space (an array with n entries – the so called feature vector of the image), we can regard the distance between two such points as a similarity measure for the corresponding images. We can then find the images similar to a search image by selecting those images whose feature vectors have a small distance to the feature vector of the search image.

However, a naive approach to the problem – comparing the feature vector of the search image to all feature vectors in the database – is rather slow if our database is large. In this article, we show how to implement a fast similarity search for even very large databases.

Weiterlesen

Ivory Becomes FOS Now – CKEditor Bundle for Symfony

Maybe you heard about it: The Symfony Bundle „egeloen/ckeditor-bundle“ was looking for a new maintainer. And the Symfony 4 compatibility was missing. Having the downloads in mind I did not expect it to be that difficult to find new maintainers. At the end Marko Kunic and I took that place. But let us take a look back into the history.
Weiterlesen

Of Love and Hate: TypeScript, Redux and immutable.js

I love Redux. It’s such an elegant and simple concept that solves so many problems. But like every other solution, adding new concepts to your code base can also introduce the occasional headache.

One of these headaches is that Redux does not enforce a lot of it’s conventions, but when you don’t adhere to them, things start breaking further down the road in strange ways.

Today, I’m going refer to one of Redux‘ three principles: State is read-only
Weiterlesen

Three ways to create Word documents with PHPWord

Creating Microsoft Word documents in PHP can be a challenge. Word offers a multitude of options and settings and while creating a document in PHP you want do take advantage of those options to achieve a satisfying result. Perhaps you need to dynamically create documents for a client and the client will only know the capabilities of Mircosoft Word, but not the limitations of PHP libraries. This can result in an unsatisfied client.

In this article we will take a closer look at PHPWord and three different ways to create Word documents with it: basic easy templating, the creation of Word documents from scratch, and (going a little crazy there) the combination of both by merging existing templates with dynamically created documents. Hopefully, after reading through the text, you will have an idea of how to implement the perfect Word creator for your needs.
Weiterlesen

DreamFactory Intermediate Service

DreamFactory is a BaaS (Backend as a Service) that connects a multitude of data sources to APIs that apps can connect to. With our Agile Anti-Pattern App (MAPA), we wanted to move the patterns database out of the app, so that we did not have to publish a new version of the app every time we added or changed patterns. The simplest way for this was to put the complete data set (a tiered json file) on a webserver and tell the app to download from there. This would solve the problem, but be a pain to edit or version. The optimal solution would of course be a somewhat normalized database of patterns, their symptoms, their remedies, categories and a pattern-categories relation.
Weiterlesen

React gets Context & Suspense. Quo vadis, Redux?

Disclaimer: this article targets developers that are using Redux with React. If you are using Redux with another Framework, this article might not be important for you.

Last thursday, Dan Abramov gave a talk on JSConf Iceland called „Beyond React 16“. A few hours later, react-etc.net featured an article titled RIP Redux: Dan Abramov announces future fetcher API. While I agree with almost nothing that article has to say about Redux, the article got one thing right: Somewhere between 6 or 12 months from now, the way we are using Redux (at least when starting a new project) will be drastically different from the way we are using it today.

But before we take a gaze into the crystal ball, let’s take a step back and see what happened.

Weiterlesen