PHP variables and strings

Sometimes you have to be reminded of the basics:

“How to use a dollar-sign $ in a string?”
In single quotes a dollar sign isn’t parsed as anything. Nothing is auto parsed in single quotes in php. If you use double quotes they are automatically parsed:

echo "$var"; // this will print the value of $var;
echo '$var'; // this will print $var;
echo "\$var";// this escapes the dollar sign so it will print $var;

Phonegap Build Android Splashscreen

Here we go again …
CLI-8.1.1 is new, new is better, ehm, except that the splashscreen stopped showing on Android. Stepping back to cli-7.1.0 solves this problem, but that is not really solving it.

<!-- Platforms to compile -->
    <gap:platform name="ios" />
    <gap:platform name="android" />

<!-- Define a specific version of PhoneGap to build -->
<platform name="android">
       <preference name="phonegap-version" value="cli-7.1.0" />
<platform name="ios">
        <preference name="phonegap-version" value="cli-8.1.1" />

Of course you search for solutions and may find out about density and qualifier, but neither keyword works. Also this link does not help by adding:

< platform name="android">
< preference name="SplashScreen" value="splash" />
< /platform>

the only “solution” so far is…

<platform name="android">
   <preference name="phonegap-version" value="cli-7.1.0" />


419 HTTP status code

… does not exist

However it did take some of my time to figure this one out as the response code was really in my webserver logfiles and as usual… I was not the first to run into this problem, see:

You get a 419 status code, if an (external) script tries to post to your Laravel application, without the o-so-needed CSRF token.

First option is to change in App\Http\Middleware\VerifyCsrfToken:
protected $except = [ ‘/*’, ];
(or maybe something more specific and a little more safe, like ‘/myapiurl/*’,)

Second option is to put the route in api.php instead of web.php, but that implies prefixing all your routes with /api/

… your choice!

The Joel Test

bron: click here.

The Joel Test: 12 Steps to Better Code

Have you ever heard of SEMA? It’s a fairly esoteric system for measuring how good a software team is. No, wait! Don’t follow that link! It will take you about six years just to understand that stuff. So I’ve come up with my own, highly irresponsible, sloppy test to rate the quality of a software team. The great part about it is that it takes about 3 minutes. With all the time you save, you can go to medical school.

The Joel Test

  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?

Continue reading The Joel Test