Null coalescing operator in C Sharp, PHP, Bash and SQL

November 27th, 2017 | #csharp #php #terminal #sql

TIL about the null coalescing operator in C#, PHP, Bash and SQL. In general, the null coalescing operator returns the result of its first operand—if it exists and is not null.

string siteName = suppliedName ?? "Default Name";

/* is logically equivalent to*/

string siteName = suppliedName != null ? suppliedName : "Default Name";
Read more

Filter by tags in Kirby

November 26th, 2017 | #kirby #php

Since a few days I have made it possible to filter my blogposts by tags. I found it very easy to implement tags in Kirby. In this blogposts I will show you how.

Read more

Use PHP header() function to send HTTP headers to client

October 30th, 2017 | #php #http #html

TIL the header() function in PHP that sends raw HTTP headers to a client.

    header("X-Content-Type-Options: nosniff");
    header("X-Frame-Options: DENY");
<!doctype html>
<html lang="en">
Read more

© 2018 Tonny Garić | With from Nijmegen, The Netherlands