CategoryTechnology

All the articles related to Information Technology related fields, including programming snippets, and other things I’m interested in

“The mess we are in” by Joe Armstrong

Great talk from Joe Armstrong on how they created Erlang, and how Programming community looked back in the days. Amazing, inspiring, worth watching:

Chromium build to replace Edge on Windows

Microsoft is building its own Chromium browser to replace the default on Windows 10. The software giant first introduced its Edge browser three years ago, with a redesign to replace Internet Explorer and modernize the default browsing experience to compete with Chrome and others.

While the modern look and feel has paid off for Edge, the underlying browser engine (EdgeHTML) has struggled to keep up with Chromium. Microsoft is finally giving up and moving its default Windows 10 browser to Chromium.

theverge

And yet, I will hold my sight. I quoted from Brad Frost 3 years ago: “But the truth is I don’t care”. 

Update: SwiftOnSecurity brings up interesting thoughts on the reasons behind this move. Mostly related with Electron, Skype for Business and EdgeHTML.

Birth & Death of JavaScript

Absolutely brilliant talk from Gary Bernhardt about JavaScript. Appearance of asm.js and all the low-level fun, that was going on in 2000’s.

This science fiction / comedy / absurdist / completely serious talk traces the history of JavaScript, and programming in general, from 1995 until 2035. It’s not pro- or anti-JavaScript; the language’s flaws are discussed frankly, but its ultimate impact on the industry is tremendously positive. For Gary’s more serious (and less futuristic) thoughts on programming, try some Destroy All Software screencasts.

320 theme collections from Rainglow

Rainglow published a great collection of editor themes, available for vim, Atom, sublime, XCode, etc.

Darkside Theme sample

CakePHP Time formatting: year of “week of year”

While jumping between PHP and JavaScript – one of the most annoying things is dates handling.

Recently, one of the clients reported that, while using our app for appointments and work schedule – they lost one of the working days. Client’s worker was supposed to work on the 31st of December 2019.

Firstly, working on the 31st is an achievement. Since we can’t affect it, “bug report” was filled on our end. After few hours of debugging, the problem was found.  

CakePHP uses Cake\I18n\Time class to handle date time. It’s an ancestor of chronos library under the hood. As a result, when you’re working with DateTime object, the formatting slightly changes. Thankfully, I was not the only one who accidentally used “year” notation wrong. 

use \Cake\I18n\Time;

$badDayToWork = '2018-12-31 09:00:00';
$time = new Time($badTimeToWork);

print_r($time);
/*
output:
Cake\I18n\Time Object(    
    [time] => 2018-12-31T09:00:00+02:00    
   [timezone] => Asia/Nicosia    
   [fixedNowTime] =>
)
*/

print_r($time->i18nFormat('YYYY-MM-dd HH:mm'));

// Output: 2019-12-31 09:00.

One tiny bit I missed was incorrect “Y” formatting flag.

yyyy (year)
2018
YYYY (year of “Week of Year”)2019

In this case, 2018-12-31 falls on Monday, so according to ICU documentation – it’s year 2019.

© 2018 Andy's Cave

Theme by Anders NorénUp ↑