Split while respecting quotes in PHP

The PHP ’explode’ function splits a string into an array based on a separator character (or separator string). This is not enough to build a parser for a template language on as most languages allow strings to contain any character. In this post we will show a function that will split while respecting quotes and one to remove the quotes while allowing for escaped quotes as part of the string. ...

April 27, 2019 · Maurits van der Schee

Automatic REST API for Laravel

This is the third post in a blog series on how to integrate PHP-CRUD-API (a single PHP file that adds a REST API to your database) into popular PHP web frameworks. In this post we integrate PHP-CRUD-API with Laravel, a PHP web framework. With 50k Github stars Laravel seems to be more popular than Symfony (20k stars) and SlimPHP (10k stars), the frameworks we have integrated with in earlier posts. Integration with these frameworks is possible as they all adhere to the PHP-FIG’s (PHP Framework Interop Group) HTTP standard PSR-7. ...

April 22, 2019 · Maurits van der Schee

Automatic REST API for Symfony 4

I’m writing a series of blog posts on how to integrate PHP-CRUD-API (a single PHP file that adds a REST API to your database) into popular PHP web frameworks. In this post we integrate the PHP-CRUD-API (2k stars) with the Symfony framework (20k stars). This is possible as they both adhere to the PHP-FIG’s (PHP Framework Interop Group) HTTP standard PSR-7. Install Symfony You need to run the following commands on your Linux system: ...

April 21, 2019 · Maurits van der Schee

Automatic REST API for SlimPHP 3

Today, about 4 years after the initial commit, the promise of “upload a single PHP file to add a REST API to your database” is still very much alive. It is now possible to use PHP-CRUD-API (2k stars) as a library executed on an endpoint in the SlimPHP 3 framework (10k stars). This is possible as they both adhere to the PHP-FIG’s (PHP Framework Interop Group) HTTP standard PSR-7. Updated! SlimPHP 4 has been released! This tutorial is for SlimPHP 3, while SlimPHP 4 has been released. It is recommended that you follow the updated tutorial here: ...

April 20, 2019 · Maurits van der Schee

Small form factor mechanical keyboards

Small form factor mechanical keyboards are popular as they are durable, portable, comfortable and exclusive. The 4 small layouts: 80% (TKL), 75%, 65% and 60% have pros and cons that I will discuss. I will also recommend affordable models, one for every layout, so you can try them out without spending a fortune. NB: This article is based on my own experience and not sponsored in any way. Keyboard size matters The common keyboard sizes are: 100%, 80%, 75%, 65% and 60%. The percentage is not related to the sizes of the key: the actual (letter) keys on these keyboards all have the same size. The percentage relates to the number of keys and their different layouts that take up less space. Below you see these different layouts (as geeky ASCII arts): ...

April 12, 2019 · Maurits van der Schee

7 web development practices challenged

There are many myths in the software business that have led to wrong best practices. In this post I will address 7 of these best practices and explain on which wrong assumptions they are based. I’m worried about the state of the industry, because I feel these are serious engineering mistakes and nobody is speaking up about them. Here we go: 1. Client side rendering Based on the wrong assumption that client side rendering is faster than server side rendering we frivolous apply React and Vue. Not even the load on the servers is diminishing as escaping data for HTML or JSON is equally expensive. Rendering HTML is faster than executing JavaScript to draw the DOM. But don’t you need to send much more data when you are sending HTML? Well not really, because you can send all dependencies in separate files. It was for HTTP 1.0 that web pages were in-lining CSS and script to avoid TCP connections. In HTTP 2.0 all requested files are multiplexed over the same connection. Today we can have multiple separate files, which increases the ability to cache these files. More cached files reduces the data transfer which makes your site faster. This is also why resource bundles should be avoided. ...

April 6, 2019 · Maurits van der Schee

Linux dream machine under 900 euro (v2)

My previous post of a Linux dream machine under 900 euro received quite some attention. Yesterday I have built an even more powerful machine and again under 900 euro. This built hits a sweet-spot between price and performance and that’s why I’ve dubbed it “v2”. NB: This article is based on my own experience and not sponsored in any way. Note: I’m a programmer, not a gamer. Read the original Linux dream machine under 900 euro for a little more background information on my use case. ...

March 29, 2019 · Maurits van der Schee

PHP-CRUD-UI updated to v2

Okay, so I finally updated my two automatic CRUD-UI projects to v2 of PHP-CRUD-API. One is written in Vue 2.6 with Bootstrap 4 and the other in PHP 7 with Bootstrap 3. The result may not be directly usable as a custom web application, but it may provide you with a quick start or as an admin interface. Use case When you are building a mobile or web app you often need to store some data centrally on a server. This is typically done using an API and a database. After creating the tables in your favorite database technology (MySQL, PostgreSQL or SQL Server) you can upload and configure “api.php” from the PHP-CRUD-API project. This gives you an API that allows you to do CRUD (Create Read Update and Delete) operations on your data. In order to manage the data you need an admin user interface interface. Uploading and configuring the “ui.php” file from the PHP-CRUD-UI project will give you this instant admin interface. ...

March 13, 2019 · Maurits van der Schee

How to fix screen tearing in XFCE

I’m running Xubuntu (Ubuntu with XFCE) on my desktop(s). My Intel NUC i7 has almost no visible screen tearing when scrolling or when playing YouTube videos. My new Athlon 200GE build (more information) does suffer from visible screen tearing when scrolling web pages or displaying fast moving video. I have found several ways to remove or reduce this ugly video artifact. What is screen tearing? I have found the following clear definition: ...

February 28, 2019 · Maurits van der Schee

Cannot copy Windows 10 "install.wim"?

Running Windows 10 is not that bad these days (I am a Linux user). It is a fast and stable operating system. Unfortunately it comes bundled with a lot of software that you do NOT want. To remove this unwanted software it is recommended to do a “clean install” of Windows 10. While doing this you may run into the problem that you can’t copy the “install.wim” file, because it is larger than 4Gb. This post has a solution to that problem. ...

February 20, 2019 · Maurits van der Schee