Change SQL mode for MariaDB in Fedora 27

After I upgraded my laptop to Fedora 27, I started experiencing some weird issues with most of the projects I am developing locally.  Trying to save anything into the database that involves dates, started throwing the following errors:

Error: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-11-30T13:30:48+02:00' for column 'timestamp' at row 1

A quick look around showed that Fedora 27 ships MariaDB v10.2, while the previous distribution version shipped MariaDB v10.1. Digging through the changes between the two versions didn’t help much, even though there is slight mention of the related change.

SQL_MODE has been changed; in particular, NOT NULL fields with no default will no longer fall back to a dummy value for inserts which do not specify a value for that field.

StackOverflow is much more helpful, as always.  These two threads – one and two – in particular, explained the changes and suggested the fix.  I had to either fix the projects I was working on, or modify my local configuration to use the old SQL mode.  This thread provided some more details, so the final solution was adding the following to the /etc/my.cnf and restarting the MariaDB service:

[mysqld]
sql-mode="NO_ZERO_IN_DATE,NO_ZERO_DATE"

And now we are back to normal.

css-purge – CSS cleaner

css-purge is a tool that does the following:

A CSS tool written in Node JS as a command line app or library for the purging, burning, reducing, shortening, compressing, cleaning, trimming and formatting of duplicate, extra, excess or bloated CSS.

What’s the difference between JavaScript and ECMAScript?

Here’s a good explanation on what’s the difference between JavaScript and ECMAScript.  I know I’m not the only one confused.

Chicken or the egg

A confusing bit of history is that JavaScript was created in 1996. It was then submitted to Ecma International in 1997 for standardization, which resulted in ECMAScript. At the same time, because JavaScript conformed to the ECMAScript specification, JavaScript is an example of an ECMAScript implementation.

That leaves us with this fun fact: ECMAScript is based on JavaScript, and JavaScript is based on ECMAScript.

I know.

It sounds exactly like the time-travel trope of people being their own parent — a little wonky, but kind of fun to think about.

JSON5 – JSON for Humans

JSON5 specification looks like a much more useful JSON, especially for those of us who are still more human than machine.  Here are some of the improvements:

  • Objects and arrays can have trailing commas.
  • Strings can be single-quoted.
  • Strings can have line breaks.
  • Numbers can be signed, begin or end with a decimal point, and also in base 16.
  • Inline and block comments are supported.

Here’s an example:

{
    foo: 'bar',
    while: true,

    this: 'is a \
multi-line string',

    // this is an inline comment
    here: 'is another', // inline comment

    /* this is a block comment
       that continues on another line */

    hex: 0xDEADbeef,
    half: .5,
    delta: +10,
    to: Infinity,   // and beyond!

    finally: 'a trailing comma',
    oh: [
        "we shouldn't forget",
        'arrays can have',
        'trailing commas too',
    ],
}

 

Mautic – Open Source Marketing Automation

Mautic is an Open Source marketing automation solution.  It features contact management, social media marketing, email marketing, forms, campaigns, reports, and pretty much everything else you’d expect from a tool like this. It is used by top digital marketing firms around the world. Mautic offers the insights necessary for sucessful campaigns and data analytics.

If you are lost between a gadzillion online tools available for marketing automation, and/or don’t trust third-party providers and want to have a system of your own, give it a try.