[Solved] Failed to load pdf in chrome when downloading with PHP

Sometimes you struggle with issues that seem to be small at first glance but still consume a lot of time to find out what the real problem is especially when the issue can only be reproduced when a specific browser or version is used. In my case I build a script to download a PDF file in PHP. It seemed to work in all browsers until a client uploaded a very specific PDF file that wouldn’t open in chrome’s buildin PDF viewer but worked in all other browsers and also offline. Ahhhrr is it a chrome bug, or did I do something wrong? Continue reading to find out what I did to solve it.

Continue reading

Help! My Synology NAS docker GUI won’t download any images anymore!

I really love my Synology NAS. But sometimes its not working completely as I expected. I have various docker containers running on my NAS and until now without any problems. But today I had an odd issue. Everytime I tried to pull the latest Gitlab CE image from the registry it started downloading but after a while is hangs and just dissapears from the list. First I thought it was my internet connection, or maybe my DNS settings. But nothing seem to work. Also not downloading other tags like specific versions. I only had the problem with the Gitlab CE image. All other images downloaded fine. Here is how I solved the issue…. Continue reading

Exposing your local webserver, testing integration external services locally

Whether you are developing inside a docker container, using vagrant or any other LAMP development environment sometimes you want to expose your local development environment to the internet. For example when you want to locally test the integration of external services like PayPal (or any other service). These services mostly require a callback url that is reachable from the internet. Without exposing your locally development environment its much harder to test these services before putting your application live. In this blog I will explain a couple of easy options that are also free to use. One of my favorite services is ngrok but I will also give some alternatives.

Continue reading

Fastest way making records unique in a huge PostgreSQL table

I am currently working on a project were we are collecting huge amount of data. Recently we discovered that millions of rows were not unique. Because we are using Machine Learning to find patterns in the data and to cluster it, these dublicate rows were polluting the results of the learning algoritme. Therefor we had to come up with a solution to remove all dublicates and prevent new dublicates in the future. Continue reading

How to Configure a Self Referencing Entity in Code First

Recently I was working on a project that required a categorization option. I wanted the user to have the option to create categories and as many subcategories as they wanted. To realize this I created a category model that was self referencing:

Continue reading

Some cool CSS stuff

css3-markupAfter my article about frontend development  where I particular focused on tools and javascript I will now focus more on CSS and styling. I can still remember the time when I started with web development and I used only inline styles. Now this is absolutely not done anymore. And that is very understandable considering that CSS has grown into a mature styling language nowadays and you don’t want to put all these logic in your html code. Continue reading