<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fabien Lasserre on Medium]]></title>
        <description><![CDATA[Stories by Fabien Lasserre on Medium]]></description>
        <link>https://medium.com/@fbnlsr?source=rss-e3d4948a81f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*9P9LQkRn-hKsp_jNA6nRVg.png</url>
            <title>Stories by Fabien Lasserre on Medium</title>
            <link>https://medium.com/@fbnlsr?source=rss-e3d4948a81f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 12:50:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fbnlsr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to get rid of the Flash Of Unstyled Content?]]></title>
            <link>https://medium.com/@fbnlsr/how-to-get-rid-of-the-flash-of-unstyled-content-d6b79bf5d75f?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6b79bf5d75f</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Wed, 22 Apr 2020 14:08:23 GMT</pubDate>
            <atom:updated>2020-04-23T08:05:48.815Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to get rid of the Flash Of Unstyled Content</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlR7bdHYZOG47wKD__7BtQ.jpeg" /><figcaption>Image by Jamie Haughton</figcaption></figure><p>This week I spent some time working on <a href="https://www.primative.net/">my website</a>’s loading performance. I started by switching from <a href="https://kenwheeler.github.io/slick/">Slick</a> to <a href="https://glidejs.com/">Glide.js</a> in order to remove jQuery as a dependency altogether. This helped me reduce the amount of JavaScript and CSS used by half (!). I then added a language preference cookie. Finally, as a simple way to enhance the user experience, I added a function which would make the switch automatically depending on the browser’s language settings.</p><p>Everything was running smoothly, but I couldn’t help but notice that my site was suffering from a <a href="https://en.wikipedia.org/wiki/Flash_of_unstyled_content">Flash Of Unstyled Content</a>, AKA a “FOUC”. It was really noticeable even with the new JavaScript and CSS in place: once a link was clicked, the page would start rendering almost immediately and then the CSS would get applied. This was really annoying as it removes the user from this smooth, almost instant experience I was aiming at. Fortunately, there are a few things we can do to prevent this from happening and get rid of that pesky FOUC.</p><h3><strong>Step 1: Hide everything!</strong></h3><p>The first thing we want to do is simply to add a CSS instruction so that our body is hidden from the page until it is ready to be unveiled. This allows the page to be fully loaded before we can finally present it to the user. This might be counter-intuitive since we’re aiming at speed, and, well, we’re <em>*slowing*</em> things there, but it’s a sacrifice we’re making for the sake of the user’s experience.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/150942d71e6c506e24c83af082940038/href">https://medium.com/media/150942d71e6c506e24c83af082940038/href</a></iframe><p>We could go with <strong>opacity</strong> instead, and make use of CSS transitions to add a bit of magic.</p><h3><strong>Step 2: Unveil when everything is ready</strong></h3><p>We then need to revert that <strong>visibility</strong> CSS property once the DOM has been loaded and is ready. For that, I’m using a simple helper function, a bit like jQuery’s <strong>document.ready()</strong> method. It calls a callback method once the document is in a “complete” or “interactive” state.</p><p>So we simply change the <strong>visibility</strong> property of my <strong>&lt;body&gt;</strong> tag to <strong>visible.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b51ac552b9b70593b8575d2f4b4d0bad/href">https://medium.com/media/b51ac552b9b70593b8575d2f4b4d0bad/href</a></iframe><p>And there you go! Our FOUC is gone. With this simple trick, our users get a better experience and don’t have a weird mess blinking on their screen before being able to browse our site.</p><h3><strong>The Firefox hack</strong></h3><p>While things should run smoothly on Chrome, you might still see a flash on Firefox. I struggled to find a solution to this problem until I stumbled upon a bug in Firefox that’s been reported <strong>3 years ago</strong> and is still active. People are still trying to fix this but lucky for us there’s a simple hack we can use as a workaround to this problem. Simply add a dummy piece of JavaScript code right after your <strong>&lt;body&gt;</strong> tag and you should be all set!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dfe54a5e62c426ee9eeaf670082015d/href">https://medium.com/media/6dfe54a5e62c426ee9eeaf670082015d/href</a></iframe><p>Pretty neat, huh? Pretty weird also, I must confess. But hey, it does the job.</p><h3><strong>Note: Think of the noscript people</strong></h3><p>Don’t forget that not everybody can or want to execute JavaScript. In that case, this simple line right before our closing <strong>&lt;/body&gt;</strong> tag will help make our site seen by everybody.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1618e96af640d050b08f38b56d18b3e6/href">https://medium.com/media/1618e96af640d050b08f38b56d18b3e6/href</a></iframe><p>And we’re all set! Now our site should be displayed correctly, without any FOUC. Yay! 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6b79bf5d75f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speed up your website in 1 minute with Instant.page]]></title>
            <link>https://medium.com/@fbnlsr/speed-up-your-website-in-1-minute-with-instant-page-b12c8d91db81?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b12c8d91db81</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Thu, 10 Oct 2019 08:42:05 GMT</pubDate>
            <atom:updated>2019-10-10T08:42:05.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GIc_D1mFTyvCw9GU54oLMQ.jpeg" /><figcaption>Image by Marc-Olivier Jodoin</figcaption></figure><p>Behind this clickbait title lies a really nifty little tool. I stumbled upon this while browsing Hacker News a while back. Actually it’s been active on this website <a href="https://github.com/fbnlsr/primative.net/commit/d862953f35a2ae0992ed11bd8c294bf8d7658a91">since February</a> now but I never took to time talk about it. <strong>Instant.page</strong> is a tiny JavaScript library which is using <em>just-in-time preloading</em> — it preloads an anchor right before a user clicks on a hyperlink.</p><p>The technique used if fairly simple: <strong>Instant.page</strong> calculates the time a user spends hovering a link (which is an obvious behavior when you want to click on something) and will start preloading said link if that time exceeds 65ms. Since <a href="https://www.nngroup.com/articles/response-times-3-important-limits/">the average human perceives actions taking less than 100ms as instantaneous</a>, <strong>Instant.page</strong> tricks the brain, hence allowing your users to get a faster, better experience.</p><p>The installation is fairly simple, just insert the &lt;script&gt; tag containing the link to the script right before the closing &lt;/body&gt; of your website (which is where all your scripts should reside anyways), and you’re all set! <strong>Instant.page</strong> will glue itself automatically to each link on the page. The library is small, a mere 1kB. It’s free and open source (MIT).</p><p><strong>Instant.page</strong> allows you to control what content should be preloaded or not. You might want to prevent it from preloading some anchors, like logout links for instance. To do that, simply add a data-no-instant attribute to said links and <strong>Instant.page</strong> will ignore them. You can even specify that you want to allow preloading for external links.</p><p>Simple, light and easy. If you want to try it yourself, check out <strong>Instant.page</strong> here: <a href="https://instant.page/">https://instant.page</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b12c8d91db81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forestry — A static website CMS]]></title>
            <link>https://medium.com/@fbnlsr/forestry-a-static-website-cms-81bebaacfae9?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/81bebaacfae9</guid>
            <category><![CDATA[forestry]]></category>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[jamstack]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 21:13:03 GMT</pubDate>
            <atom:updated>2018-06-15T21:13:03.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHB-m4b31wLuzA5BiwVjiQ.jpeg" /></figure><p>Static websites are getting more and more popular. While some might denigrate this “back to the roots” approach, these systems have numerous advantages. They’re often faster because they’re limited to serving simple web pages, with barely any workload on the serve. The logic is left to be handled by the client, mostly via the usage of APIs, and it’s much easier to put resources in cache and use a CDN during deployment. Besides, these are considered atomic as they allow instantaneous cache invalidation. The website deliverability is therefore 100% assured. Static websites are also often much more secure, as they don’t allow information to be directly sent to the server.</p><p>That being said, the update and deployment of a static website has to be made from a machine equipped with the suitable development environment. A terminal, and tools such as Git, Node, NPM, Ruby and others are often necessary. Indeed, the website has to be compiled beforehand or thanks to an automated process such as GitHub Pages or Netlify.</p><h3>On the need for a static CMS</h3><p>The need for a static CMS therefore makes sense for multiple reasons. First it allows to overcome the need for a development environment. In the case of a blog, the creation of articles becomes much more fluid, and being able to get away from this technical environment allows for a better workflow for the content creation process. Secondly, it allows non-technical users to manage their website and let them be more free in creating and managing editorial content.</p><p>Today I’m trying out Forestry, a hosted service which makes use of the GitHub API in order to allow a static website to be remotely managed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*RVnG2a9gO9w0ouEj.jpg" /></figure><h3>Installation</h3><p>The installation of the CMS is extremely simple: I just had to create an account on Forestry, link it with my GitHub account and select the repository for the website in question. I then had to specify if the website is generated by Hugo (which is my case) or Jekyll. Quick note: I had to specify the version of Hugo I’m using, and the ones given by Forestry will not necessarily correspond to yours. It wasn’t a problem for me as I’ve configured Forestry not to generate my website, but it’s something to consider.</p><h3>Configuration</h3><p>Forestry’s configuration is just as simple. Its system will browse through your repository and generate content types depending on what it finds. All in all, it took me five minutes to have a working back-office and I was able to be productive right away.</p><p>It’s even possible to inject the CMS inside your own site and go through a URL you specify (for instance <a href="http://www.example.com/admin">www.example.com/admin</a>), which allows you not to leave your own website.</p><h3>Usage</h3><p>Forestry works by using GitHub, Gitlab or Bitbucket’s API. It’s a fairly simple CMS to use with a clean interface. On the left, a panel listing all the content types allows access for the different categories of the site, and on the right a Wordpress-like panel displays to the Front Matter fields and the main text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wkSPduzl1g5XYLLi.jpg" /></figure><p>In my case, Forestry did an incredible job finding all my blog posts and projects, but was a bit limited when it comes to pages content. Thus, for an unknown reason, the system thought my home page and the “About” page were different, and it put them in two different sections.</p><p>I was surprised to see that even though Forestry uses GitHub’s API, it’s not possible yet to access a content history.</p><p>It’s however possible to rename the file (automatically generated by the CMS) in order to benefit from Hugo’s multilingual support. Thus, by only adding the extension .fr to an existing slug, I was able to let Hugo automatically link two blog posts and suggest the translated version to the visitors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s8kaSYJeGvZmBOj2.jpg" /></figure><p>In my case, a “project” is exclusively configured thanks to the Front Matter. By changing a couple of lines from the config file, I was able to get rid of the text editor and simply have the configuration fields for a project. For Wordpress users, it’s equivalent to having a page constructed thanks to the Advanced Custom Fields plugin, but generated thanks to a YAML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lazfn26fOVFg09Po.jpg" /></figure><h3>Pros and cons of the CMS</h3><p>The first obvious con of using this type of CMS is the “technical” aspect that remains very strong even in the presence of a graphical interface. Knowing how to name files is a must in order to allow Hugo to handle them, and some aspects of the interface might scare some users.</p><p>It would have been smart to allow for a hidden, automatic way of naming content files, thanks to a slug system inside the configuration file, and change the language thanks to a select input.</p><p>Adding “users” with restricted permissions is reserved to the “Business” plan which starts at $9 per user per month. In its free version, it’s possible to add “guests” who have almost all rights on the site, which can become pretty problematic.</p><p>For instance, you should note that when it comes to Hugo sites, Forestry enforces the TOML format for the Front Matter and config files. In my case, Forestry detected “menus” for my projects, which are not used anywhere. In trying to test this feature and changing the order of this menu, Forestry decided to rewrite 47 files, including Hugo’s config (writing TOML syntax inside a YAML file), which completely broke my build system. I had to use Git to undo these modifications and come back to a previous working version.</p><p>On another side note, it is to be considered that Forestry lives in Git, and therefore is going to generate a multitude of commits, that won’t certainly respect your commit convention. It’s small point, but it’s something to think about.</p><h3>Wrapping up</h3><p>After writing all this, one might seem that I did not enjoy my time with Forestry, but it’s far from the truth. While it has some flaws, the team behind it is constantly working on improving it. That being said, and when considering how easy it is to install and use this system, I’d say it’s a really solid choice as a static CMS. It allows to find a certain flexibility when administrating a website while still benefit from the advantages of speed, security and optimizations of a static website generator.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81bebaacfae9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 essential extensions for VS Code]]></title>
            <link>https://medium.com/@fbnlsr/10-essential-extensions-for-vs-code-fdfa17f4f66c?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdfa17f4f66c</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[visual-studio]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Fri, 20 Apr 2018 09:48:11 GMT</pubDate>
            <atom:updated>2018-04-20T09:48:11.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9pTH7fpkN2SUCHSGG-HXQ.jpeg" /></figure><p>I’ve been using <a href="https://code.visualstudio.com/">Visual Studio Code</a> as my main code editor for more than two years now. I used to work with Sublime Text, which was an amazing software (especially coming from Notepad++), but the guys at Microsoft are constantly doing an amazing job at making their editor the best out there, and their monthly update shows how dedicated they are to keep at improving it.</p><p>So it’s been my editor of choice, but a good editor would be nothing without good extensions. I’ve compiled a list of my 10 favorites (plus a few more) extensions I could not live without. They make my day to day work much easier and allow me to save so much time in the long run. Here they are (in no special order):</p><p><a href="https://marketplace.visualstudio.com/items?itemName=bierner.color-info"><strong>Color Info</strong></a></p><p>VS Code provides a tiny preview box for colors in CSS files. Color Info allows you to get a much better view of the color your mouse hovers, complete with CMYK or alpha values. It can even act as a color picker, which is really convenient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnmFgpXryX41gURVOJIZcQ.png" /></figure><p><a href="https://marketplace.visualstudio.com/items?itemName=bierner.emojisense"><strong>:emojisens:</strong></a></p><p>You know <a href="https://www.primative.net/blog/lets-talk-about-emojis/">I love emojis</a>. This extension allows you to directly insert emojis or type emoji codes in your files. Say you wish to insert a joystick emoji. Just begin to type :joy for instance and you’ll get an auto complete window pop up which will allow to directly insert the 🕹 icon. If you type in ::joy, it’ll insert :joystick: along with a preview of the emoji. It’s great!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=waderyan.gitblame"><strong>Git Blame</strong></a></p><p>As its name states, this simple extension shows the git blame of the current selected line in the status bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*hkOSeEusOXfnncnBhYGysA.gif" /></figure><p><a href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one"><strong>Markdown All In One</strong></a></p><p>I absolutely love Markdown. Actually this whole site makes extensive use of markdown, as it is built with Hugo. This extension helps you write Markdown by adding shortcuts such as Cmd + B for bold text, Cmd + I for italics, and so on. So convenient!</p><p><a href="https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync"><strong>Settings Sync</strong></a></p><p>If you’re like me and work on multiple (sometimes virtual) machines, this extension is wonderful! It allows you to sync your settings and extensions thanks to a Github Gist that gets downloaded/uploaded.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight"><strong>TODO Highlight</strong></a></p><p>As the name states, it highlights TODOs, FIXMEs and any keyword you specify. Just write TODO: somewhere and not only will it highlight it, but it’ll also list all the ones you’ve already written anywhere in your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RH4xO1sLCBmpTHMwNEYEA.png" /></figure><p><a href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"><strong>Vetur</strong></a></p><p>This extension is a swiss knife for Vue. From autocompletion to snippets, it’s a must-have for any frontend developer.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=ban.spellright"><strong>Spell Right</strong></a></p><p>A multilingual, offline and «lightweight» spellchecker. Spell Right uses your built-in dictionaries to check for errors, and can check for errors in any (and even multiple) language anywhere within your project. Watch out for big files though, as it can sometimes take some time to operate. I usually have it toggled off by default. It’s easy to ask it for a spell check just by clicking on the eye icon in your status bar.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig"><strong>EditorConfig for VS Code</strong></a></p><p>Strangely enough, VS Code does not support <a href="http://editorconfig.org/">EditorConfig</a> by default. Just install this extension and it’ll instantly start listening to any .editorconfig file it encounters.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks"><strong>Bookmarks</strong></a></p><p>Now this one I use it constantly! Bookmarks is an extension that puts little blue bookmarks in your file gutter. It’s extremely handy when you need to switch between positions inside a file, or if you need a quick reminder anywhere in your project. I’ve set up mine with shift + cmd + = (toggle bookmark) and shift + cmd + - (next bookmark) and thanks to this I can jump around files without having to leave my keyboard. The extension also adds a small panel right below your file browser which lists all active bookmarks in the current project. A must-have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*0FlGKF5Q5R_p9iC3yZ90eA.png" /></figure><h3>Honorable mentions</h3><p><a href="https://marketplace.visualstudio.com/items?itemName=JerryHong.autofilename"><strong>AutoFileName</strong></a></p><p>This extension is pretty straightforward. Just type in the beginning of a file/directory and it’ll autocomplete its name for you. Really handy when you need to point to a file inside node_modules.</p><p><a href="https://marketplace.visualstudio.com/items?itemName=JakeWilson.vscode-cdnjs"><strong>cdnjs</strong></a></p><p>Most of the time I inject my dependencies in my Javascript files thanks to Webpack. But whenever I need to mockup something quickly, this extension has my back. Using the command palette, you’ll be able to insert URLs or script/style tags of all the libraries cdnjs handles. Quite handy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*027mEa823jvg9NLJUDZehg.gif" /></figure><p><strong>Got one to share?</strong></p><p>So here are a few extensions I use every day. If you’ve got one I should check out, hit the comment section or <a href="https://twitter.com/fbnlsr">send me a tweet</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdfa17f4f66c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s talk about emojis]]></title>
            <link>https://medium.com/@fbnlsr/lets-talk-about-emojis-d0a07c88b319?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a07c88b319</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[emoji]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Fri, 12 Jan 2018 10:44:29 GMT</pubDate>
            <atom:updated>2018-01-12T10:44:29.981Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4YNb29qddL8n5qM07CPXA.jpeg" /><figcaption>Cover image: Nong vang</figcaption></figure><p>Emojis are everywhere. From Twitter to Facebook Chat, they’ve grown to become Oxford’s 2015 <a href="http://time.com/4114886/oxford-word-of-the-year-2015-emoji/">Word of the Year</a> and even featured in a <a href="https://www.rottentomatoes.com/m/the_emoji_movie">horrendous movie</a>. But what about outside SMS and instant messaging? What about using emojis inside code comments or even git commit messages? Let’s find out how we can make the best use of these funny little pictures.</p><p>Contrary to what people may think, emojis have been around for quite some time. The first emoji dates back to 1999, and was created by Shigetaka Kurita, a Japanese telecommunication planner for NTT Docomo. At first used solely in Japan, it took those little pictures ten years for some of them to be added to the Unicode character space. Thus, in October 2010 the Unicode Standard 6.0 got released, and with it 722 emojis. They do not live in their own dedicated blocks though and are spread around the Unicode tables. It took years for multiple engineers working at Google and Apple to convince the Unicode Technical Committee to add them. Now emojis are a part of everybody’s life.</p><p>There are even some quirks and fun little facts about these tiny pictures. For example: emojis can vary from one platform to another. Because of that, the calendar emoji is represented always showing July 17 on Apple products (that date representing the announcement of iCal back in 2002). This led people to “wrongfully” declare July 17 World Emoji Day.</p><p>Emojis are also represented differently across platforms, and can be interpreted slighly differently. Take for instance the astonished face emoji. The first one is Apple’s interpretation, the second one is Samsung’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*qH5DK4D4VU7sHtiLAd_1Xg.png" /><figcaption>Samsung’s version feels more shocked than astonished.</figcaption></figure><p>Apple’s take on this feeling feels a bit more tamed than Samsung’s, don’t you think?</p><p>Other times, it can be the contrary. In this example, Samsung’s interpretation of the pouting face feels less “angry” than Twitter’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*8T726FAx2bCgzaHp8qwbCQ.png" /><figcaption>In that case, Twitter’s pouting face looks angrier than Samsung’s.</figcaption></figure><p>But enough with the history, let’s get down to coding.</p><h3>Emojis in git commit messages</h3><p>Github has popularized emoji support inside their ecosystem in a <a href="https://github.com/blog/1289-emoji-autocomplete">blog post from 2012</a> thanks to their now famous “:” shortcut. So now, say you want to use the fox face emoji 🦊 somewhere in Github (a commit message, an issue or a gist), you can simply use :fox_face: instead and it will automatically be interpreted by Github.</p><p>Using shortcuts is an elegant solution to circumvent emojis not being interpreted. You don’t take the risk of breaking something and even if they’re not (or badly) rendered, the messages are still readable.</p><p>Emojis can also add a lot of clarity to commit messages. Compare these two sequences:</p><pre>- Fix editing user not being saved to the database<br>- Cleanup code<br>- Add the ability to edit a user<br>- Fix bad function callback on API request</pre><p>And:</p><pre>- 🐛 Fix editing user not being saved to the database<br>- 📝 Cleanup code<br>- ✨ Add the ability to edit a user<br>- 🐛 Fix bad function callback on API request</pre><p>You can immediately see where bugs were fixed and where new features were added.</p><p>On a platform that doesn’t support emojis, this would be read as:</p><pre>- :bug: Fix editing user not being saved to the database<br>- :memo: Cleanup code<br>- :sparkles: Add the ability to edit a user<br>- :bug: Fix bad function callback on API request</pre><p>Definitely not as fun, but still perfectly readable.</p><p>The tech industry as a whole appropriated these shortcuts and <a href="https://www.webpagefx.com/tools/emoji-cheat-sheet/">went far beyond</a> simple emojis. Sure it’s nice to use 🐛 to talk about fixing a bug, but try using :trollface: in Slack or Redmine. Boom, you’re the new cool kid on the block. Don’t use it too often though, you don’t want to be <em>that guy</em>.</p><p><strong>My advice:</strong> Don’t hesitate to use emojis in git commits, but do prefer short-codes. I would also suggest not to go overboard with it and stick to a list of a few ones to denote the major actions (bugfix, new feature, styling, code cleanup, etc..).</p><p>If you’re not sure were to start or want to suggest a guideline for your team, I highly recommend Carlos Cuesta’s <a href="https://gitmoji.carloscuesta.me/">Gitmoji</a>. It even comes with a nifty CLI (simply called <a href="https://github.com/carloscuesta/gitmoji-cli">gitmoji-cli</a>) which will help you write your commit messages through an interactive interface. Gitmoji is even used in Atom’s <a href="https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages">contribution guideline</a>.</p><h3>Emojis in/as code</h3><p>Technically, you <em>could</em> use emojis in computer code, but you should be very careful when doing so. Emojis are interpreted as strings in Javascript, but their length can vary.</p><pre>&quot;🐼&quot;.length         // returns 2<br>&quot;🇨🇦&quot;.length         // returns 4</pre><p>Don’t forget emojis can be connected (kind of the same way Fira Code gets you those sexy sexy ligatures). That’s how you can now get skin color modifiers (called EMOJI MODIFIER FITZPATRICK TYPE-1, -2, -3, -4, -5, and -6. I’m not kidding). Or even better, if you combine the following emojis: 👨, 👩, and 👧, you get a whole family 👨‍👩‍👧! Let’s run that through Javascript.</p><pre>&quot;👨‍👩‍👧&quot;.length         // returns 5</pre><p>Why 5? Because not only do you get the length of each emoji that symbol is made of, but it also uses two ZWJ (Zero Width Joiner) characters as “glue”. You can even see it in action: copy/paste that emoji inside VS Code for instance, and it’ll take you five “arrow key” strokes to go through it.</p><p><strong>My advice:</strong> Do not to use emoji in code logic. Plain and simple. But you can still use them in your views. Web browsers have amazing emoji display capabilities, and know how to fallback to a font that <em>will</em> display your “thump up” icon. But watch out and be careful when using an emoji short-code interpreter in those views, especially if you happen to display code blocks on your website. It could trick you, interpreting h:m:s as hⓂ️️s, thus making the code block useless.</p><h3>Emojis in code comments</h3><p>So what about code comments? Emojis everywhere! As far as I know, you are not susceptible to break anything because of emojis in comments. Modern code editors (Atom, VS Code, Sublime, Intellij…) have amazing emoji support. They even can be pretty useful to make something stand out.</p><pre>/**<br> * WARNING: Do NOT change this file.<br> */</pre><p>Compared with:</p><pre>/*<br> * 🛑 WARNING: Do NOT change this file.<br> */</pre><h3>Final thoughts</h3><p>Emojis are a double edged sword. They allow us to express complicated feelings in a quick and fun way. They are the extension of the emoticons we used profusely back in the IRC glory days. They can be used as decorators, adding feeling to an otherwise plain sentence. They also can be used as markers to make something stand out, and even as a complete communication tool when used on their own.</p><p>However, since they’re not designed and interpreted uniformly across platforms, they can be the source of misunderstandings. Communication relies on the stability of its mean of propagation. If a symbol is changed between the sender and the receiver, the message is not the same. As characters, they also need to be put in context. That’s why some of them had to be changed. For instance the :gun: emoji 🔫 which used to be represented by a real gun, is now a water pistol.</p><p>When it comes to code though, I’m all in favor of using emojis. Not in the code itself, as I’ve stated, but rather in comments and commit messages. They embelish the message they’re attached to, for they are generally mainly used as pointers. And with the help of short-codes, you can use them without the fear of breaking something.</p><p>If you want to know more about emojis, you should check out <a href="https://meowni.ca/">Monica Dinculescu</a>‘s work, and especially her talks.</p><p>I also recommend Angela Guzman’s post on <a href="https://medium.com/@agzmn/the-making-of-apples-emoji-how-designing-these-tiny-icons-changed-my-life-16317250a9ee">the making of Apple’s emoji</a>. Angela writes how she and her mentor Raymond designed over 500 emojis during her internship back in 2008. This changed her life, and her work is now in the hands of millions of people.</p><p>So go ahead and emoji away, you’ll improve readability and break away from the monotony of a dull screen filled with code. 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a07c88b319" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My backup strategy]]></title>
            <link>https://medium.com/@fbnlsr/my-backup-strategy-6595fb5f247e?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/6595fb5f247e</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[synology]]></category>
            <category><![CDATA[nas]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[backup]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Wed, 03 Jan 2018 17:27:17 GMT</pubDate>
            <atom:updated>2018-01-03T17:27:17.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGqt7Ub-wWZC6W0RDYdcMA.png" /><figcaption>Photo: Patrick Gradys</figcaption></figure><p>The protection of digital assets is a multi-million dollar industry. Whether we’re talking about military, financial or scientific data, each industry has to be prepared in the event of a loss, and plan for security. They often roll out extreme measures, going as far as having their own (and doubled) dedicated electrical power lines. But what about safeguarding your friend’s latest BBQ party pictures? Or your little one’s first steps video? Here’s how I’ve learned my lesson from a tragic system failure and what my current setup looks like now.</p><p><strong>A catastrophic failure</strong></p><p>Back in 2008, I made myself a custom NAS (<strong>Network Attached Storage</strong>) using some old computer parts, a bunch of 500 GB hard drives and a copy of <strong>FreeNAS</strong>. The OS ran off a nifty 512 MB IDE flash based drive, and the data array was configured to use <strong>RAID5</strong>. That meant that if a drive was to be damaged, I could always put a new drive in the array and the data would rebuild itself. Note the conditional tense. That’s because it worked flawlessly until we moved in 2010. And we stored the NAS in a box next to a speaker with a huge magnet for a month. And two drives failed.</p><p>I spent weeks trying to figure out a solution on how to rebuild the data I had lost. But after some time I had to face the reality of things. It was in vain. Years of family photos and videos, an entire MP3 collection, all my video games… It was all lost, forever. My girlfriend was in tears and my “geek pride” after spending all that time planning and building this whole system took a serious hit. I was using hot data as a storage, and at the time I had no backup strategy. Of course I had recovery options, hence the RAID5, but I was not prepared for such a catastrophic failure. And when it comes to computer security, you <em>*have*</em> to prepare for the worse.</p><p>Years later, I learned my lesson. So here is how I handle my digital life now.</p><p><strong>My current setup</strong></p><p>My current setup is mainly built around two things: a new NAS, that I bought and not built, and a backup software that automates how data is handled.</p><p>The NAS I’m using now is a <strong>Synology DiskStation DS214se</strong>. It’s a very simple machine, running on a 800 MHz dual core CPU, with 256 MB of RAM and two hard drive bays. I put in there <strong>two 2 TB Western Digital Green</strong> hard drives, and configured a single array to be run in <strong>RAID1</strong>: everything that’s on one drive gets mirrored to the second one. That means that I lose half of the hypothetical storage space but if one drive fails, I can change it and the data will automatically rebuild itself.</p><p>The NAS sits on top of an <strong>APC Uninterrupted Power Supply</strong>. If power is lost in my apartment, the NAS keeps running and I can manually (and safely) shut it down either by using its physical power button (which sends a power off command) or even my phone (my router is also plugged in to the UPS, so even without power I still have internet and network access for a few minutes).</p><p>My main backup strategy is handled by an amazing software called <strong>SyncBack Free</strong>. This software allows me to set up various backup scenarios, called profiles. The main profile is a <strong>physical backup</strong> to an external hard drive. When I bought the Synology NAS, I got a third 2 TB drive that is now used as a backup. This is my first failsafe. This is what lacked in my previous setup. Once the backup task is done, that drive is stored <strong>offline</strong> and <strong>off-site</strong>, so it doesn’t have to suffer from electrical malfunctions. And even in the event of a fire or flood at my place, my data is safe.</p><p>SyncBack then runs two more jobs. Amongst all the data I’ve lost with that old setup, the loss of family photos were the hardest to cope with. One can always replace music or movies they used to love, as there’s a never-ending stream of entertainment to consume. But memories do fade away, and are impossible to retrieve. So I’ve decided to add another redundancy layer to my backup strategy when it comes to photos and store them online, in my <strong>Google Drive</strong>. SyncBack compares the content of the NAS folder and my Google Drive, and updates the later with the former before performing a <strong>Cyclic Redundancy Check</strong> of each file to see if they are the same on both sides.</p><p>I should note that I could use two different apps on the NAS and have it handle these two backups automatically: <strong>USB Copy</strong> and <strong>Hyper Backup</strong>. After trying out both apps in different scenarios, I’ve decided not to use them as they either store data in a proprietary format (Hyper Backup) or add a bunch of <strong>._</strong> prepended metadata files to my existing directories (USB Copy). I like the fact that if I ever need to retrieve my files outside of Synology’s ecosystem, I still can use a good old `cp` command to get my files back.</p><p><strong>But wait, there’s more!</strong></p><p>So my data is stored on a RAID1 array, and on an offline hard drive. And the photos are backed up online on my Google Drive. I could have stopped there but I thought that it was not enough. Thanks to my <strong>Amazon Prime </strong>subscription, I can upload an infinity number of photos on their <strong>Amazon Drive</strong> cloud service and it won’t affect my otherwise limited quota. So hey, let’s take this opportunity! Another SyncBack profile backs up the content of my Photos directory to Amazon’s servers. I like the fact that my data is stored on two different storage providers. Google and Amazon each have their own infrastructure, so in the event of a failure of astronomical proportions at either one of these places, I <em>*may*</em> still be safe.</p><p>But why stop there? My photos are stored on four different locations now (The NAS, the external hard drive, Google Drive and Amazon Drive). But what about the rest? My music, my documents, my family videos? Well of course they’re on the NAS and the external hard drive, but I figured I needed another failsafe. Because so far my backup strategy relies on what could constitute a <strong>single point of failure</strong>: SyncBack. If the software behaves badly or one of my backup profile is not properly configured, I may end up with nothing but a bad save on various locations. I also don’t have access to the external hard drive that easily, so if I need to do a backup at any given time, I need to prepare the operation at least a day in advance.</p><p>That’s why I took a subscription to <a href="https://c2.synology.com/en-us"><strong>Synology C2</strong></a>. It is a fully integrated service that runs natively on <strong>DSM</strong> (<em>DiskStation Manager</em>: Synology’s own operating system) and allows me to back up the whole NAS (minus my movies and TV shows, these are not important) to Synology’s servers. It uses AES-256 to locally encrypt the data before sending it on the network. I’ve set it up so it does an automated backup every first day of the week, and then do an integrity check two days later.</p><p>I also considered Online’s <a href="https://www.online.net/en/c14">C14</a>, as they’re really cheap and you can send files over (S)FTP but unfortunately they do not support Synology.</p><p><strong>Room for improvement</strong></p><p>So this is what my current setup looks like now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*NuiyChWDf8zIN5QtcN-SJw.jpeg" /></figure><p>Each file is physically stored on up to 6 different location, with various levels of failsafe measures.</p><p>Is this setup perfect? Of course not. First and foremost, it lacks automation. I still have to start each backup task (except for the C2 one) manually, and it is prone to error. I’m working with live data so the array is constantly changing, but this is a backup, not a long term cold storage. And the external hard drive I’m using has to be transported and manipulated, so that’s another weak point in the system.</p><p>One thing I’ll probably change soon is the model of the hard drives I’m using. WD Green are “fine” but they are not made for being used in a NAS. So I think I’ll switch them for either WD Red or Seagate Ironwolf line, and probably take the opportunity to do a slight storage upgrade to 3 or 4 TB.</p><p>All in all, the main problem with backup strategies is that they’re never perfect. Just look at <a href="https://techcrunch.com/2017/02/01/gitlab-suffers-major-backup-failure-after-data-deletion-incident/">what happened at GitLab</a> a few months ago, or even the catastrophic failure that <a href="https://www.theregister.co.uk/2017/07/13/watercooling_leak_killed_vnx_array/">brought OVH to its knees</a> for hours.</p><p>One cannot be fully prepared against data loss. Still, I can say that I feel <em>somewhat confident</em> with this strategy, and I’ve tried to think about every scenario (even solar flares, but they’re a whole another animal). We’ll see how and where my data sits in a few years.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6595fb5f247e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So long LastPass, hello KeePassXC!]]></title>
            <link>https://medium.com/@fbnlsr/so-long-lastpass-hello-keepassxc-461638b057f5?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/461638b057f5</guid>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[lastpass]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Fri, 06 Oct 2017 08:51:15 GMT</pubDate>
            <atom:updated>2017-10-06T08:51:15.212Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpriYS0PugqoJ7cR1FZhIw.jpeg" /><figcaption>Photo: Victoriano Izquierdo</figcaption></figure><p>I’ve been a fervent advocate of password managers for years. You can ask pretty much anyone in my family or amongst my friends, there was a time where I *<em>had</em>* to ask the question “By the way, what do you use to store your passwords?”. This was usually followed by a 20 minutes speech about how unsecure their digital life was and a desperate attempt at convincing them that MUST use a password manager. That was, of course, I didn’t faint learning that my friend or relative is using the same 7 letters password for absolutely EVERYTHING, “oh and it’s *<em>hunter2</em>*, I don’t mind telling you, I have nothing to hide”. Yes, that happened.</p><p>For the past four years or so, my password manager of choice has been <a href="https://lastpass.com/">LastPass</a>. I’ve been a happy Premium member ever since, and even though it’s had a few hiccups (in <a href="https://blog.lastpass.com/2015/06/lastpass-security-notice.html/">2015</a> and in <a href="https://www.theguardian.com/technology/2017/mar/30/lastpass-warns-users-to-exercise-caution-while-it-fixes-major-vulnerability">2017</a>), they’ve been pretty transparent about the situation each time and I chose to keep trusting them. I used to log into my account using two-factor authentication: my Master Password and a <a href="https://www.yubico.com/">Yubikey</a>, and it’s been working flawlessly for years. However, after a long consideration, I’ve recently chosen to say goodbye to LastPass and continue my journey with another solution. Here’s why.</p><h3>A WW1 tank painted pink stays a WW1 tank</h3><p>You see, the problem with computer security is that you always have to find the proper balance between how safe you need to be and the convenience of day to day usage. My setup was somewhat secure, but the convenience wasn’t there anymore. I usually have to log into my LastPass account several times a day, as I’m using several web browsers, with sometimes several profiles per browser. Therefor, since LastPass automatically logs out whenever a new session is opened somewhere else, I also had to use my Yubikey multiple times per day, even per hour. In the end it was starting to become a burden. Besides LastPass has made some changes to its UI, and is focusing more and more on being as easy to use as possible, and in a way as “opaque” as possible. While I’m all for it, as it draws more and more people to being safer on the web, it can result in really annoying results under the hood. Often, the browser extension does not catch the proper fields for the username/password combo. Or when I’d use the password generator, it didn’t necessarily register it properly. It has some difficulties dealing with websites which make use of AJAX requests. It often saves uselessly complicated URLs that are generated during the signup process, making a lot of its database entries dirty. If you’re not tech savvy, it’s still an amazing product, and it’s <strong>way better</strong> than using nothing or that old post-it note that’s on your computer screen. But for me, what was once a really good tool to use had become a burden. It was time for something new, or in this case something old.</p><h3>Enters KeePassXC</h3><p><a href="https://keepass.info/">KeePass Password Safe</a> has been around for 13 years. The interface shows its age, but its ease of use and the security features it offers has been proven multiple times. Besides the usual username/password combo, you can specify custom fields, and even attach files to your password database. Speaking of which, KeePass uses AES, TwoFish or ChaCha20 as cipher for the database, and the passwords it contains are protected in memory. It does pretty much everything LastPass does (or the other way around depending on your point of view), albeit with a less fancy UI and a less “automated” process.</p><p>The particular flavor of KeePass I’m using is called <a href="https://keepassxc.org/">KeePassXC</a>. It’s a community-driven fork of the now defunct KeePassX, which was aimed at being a multi-platform version of KeePass. So it works perfectly on Windows, MacOS and Linux. Exporting the database from LastPass and importing it into KeePassXC demands a bit of work, as you have to use a cumbersome CSV file (which you must not forget to destroy!) LastPass export tool provides you with. LastPass’ “Secure Notes” are stored in an XML-like format, and you’ll probably have to rewrite them manually inside KeePassXC after the import. But after that tedious task is done, using KeePassXC is really easy, and it works flawlessly. Whenever you need to retreive a password, simply switch to the app and hit Cmd+F, type in the first letters of the entry you’re looking for and a simple Cmd+C / Cmd+V does the trick. It litterally uses less than five seconds. If you’re using a browser extension, it can even automatically fetch your credentials and is therefor as fast as LastPass, if not faster.</p><p>The setup I’m using now is as follows. The password database file is stored on my Google Drive. This allows me to have a silent synchronization between my different devices, and provide me with an online backup. I’m using both my Master Password (with a 100+ bits entropy) and a key file (which is stored locally, <strong>not</strong> on Google Drive) to unlock the database. It can communicate automatically with my various browsers thanks to two extensions: chromeIPass and PassIFox. The database file and the key file are backed up on a Network Attached Storage drive, and two offline copies.</p><h3>Is everything right?</h3><p>So I’m finally happy again. The main “problem” I have with KeePassXC is its UI. In these days of Flat UI and Material Design guidelines, the software feels really dated. It also lacks some basic features such as showing which fields can be displayed in the entries columns, and my biggest gripe: custom fields do not show straight away when you search for a specific entry. Let’s say for instance you create an entry for a credit card. It contains several custom fields such as the card number, its expiration date and the CCV. KeePassXC won’t show those fields unless you go and edit the entry to display the custom fields, or you right click and select one of the “copy attributes” options. It would have been much better if each entry could be displayed in its entirety on a single pane, minus the protected fields of course.</p><p>I should give an honorable mention to <a href="https://keeweb.info/">KeeWeb</a>, a web app (available as an Electron desktop app as well), which tries to rejuvenate KeePass in that regard. But it poses even more security problems than KeePass does. I won’t go into too much details in this post, but the flaws are easy to guess.</p><p>All in all, I feel much better using KeePassXC than I was using LastPass. Of course, this solution is not the most secure there is, especially by storing the database file on the cloud. I could fix this issue by using a self-hosted cloud service like OwnCloud or Bitorrent Sync. But once again, the balance between security and day to day usage would have been lost. I’d love for KeePassXC to support TOTP so that I could use again my Yubikey and get rid of the keyfile, but so far I feel confident in that solution.</p><p>By the way, what do you use to store your passwords?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461638b057f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Push notifications: Kill the noise]]></title>
            <link>https://medium.com/@fbnlsr/push-notifications-kill-the-noise-381f1faa5c2c?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/381f1faa5c2c</guid>
            <category><![CDATA[apple-watch]]></category>
            <category><![CDATA[wellness]]></category>
            <category><![CDATA[life-hacking]]></category>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[phone-addiction]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Tue, 26 Sep 2017 14:56:45 GMT</pubDate>
            <atom:updated>2017-09-26T15:05:07.281Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-T4w6Lssr9odVt_6FISZw.jpeg" /><figcaption>Photo: Gian Prosdocimo.</figcaption></figure><p>Ever since last summer, the first thing I do whenever I install a new app on my phone is to go into its settings and completely turn off push notifications.</p><p>When Apple came up with push notifications back in 2009, they were a godsent. No longer did we have the need to check our phone to see if a new email had arrived! Whenever something important happened, a subtle *Ding!* or a quick vibration alterted us of an incoming tweet or appointement. It was a great way for the user to stay in touch with their digital world.</p><p>The problem is that now, each and every app thinks it’s the most important thing and you HAVE to listen to what they say. Congratulate Helen for her new job! Marc is tweeting about #takeaknee! Don’t forget to check on your Happy Dragon’s Eggs! Tom has posted for the first time in a while! It has become so dominant that now it feels like notifications are nothing but noise. So much so that people have started to develop new diseases such as <a href="https://en.wikipedia.org/wiki/Phantom_vibration_syndrome">Phantom Vibration Syndrome</a>. How often do you think you get a new notification and reach for your phone, but it turns out that it was just your brain tricking you. There are even people who are experiencing anxiety related to notifications. The constant flow of information has become overwhelming, and it just won’t stop. And now, you can also get push notifications from websites. While I love the technology behind it, it’s unfortunately so badly used by web developers around the globe. Each and every website wants your authorization to notify you about the latest trend in whatever they’re talking about. It’s presented as a way to deliver a better service, but let’s not kid ourselves: it exists for the solely purpose of making you come back there, and present you with just a few more ads.</p><p>Last year I bought myself a Pebble. It’s a great little gadget that goes around my wrist and vibrates whenever I get a notification. Thanks to it, I can’t miss a single email, phone call or text. It’s also nice because it’s discreet. It’s been a year since my phone last chimed, and now that it’s always on silent mode, it doesn’t bother my coworkers when I’m in an open space, or my family during our sunday lunch. I’ve started to look less at my phone, because since it’s connected to my watch thanks to Bluetooth, I won’t miss a notification as long as the phone is less than 10 meters aways from me. But I’ve realized that it was at my own expense. The problem is that I started the bad habit of constantly having to look at my watch. Whenever my phone needs my attention, I get these three taps on my wrist that remind me it’s there, and it needs me to take care of it. While fun at first, it started to feel like a dog collar, and that Bluetooth link started to feel more like a leash than a usefull tool.</p><p>So I’ve decided to turn it all off. The only notifications I’ve kept on my phone are Emails, and everything that’s *directly* aimed at me (Telegram, Twitter DMs and SMS). That’s it. LinkedIn is quiet, Instagram as well, and I’ll check on my Amazon deliveries whenever I damn please. On my desktop, I’ve disabled all notifications as well. Now I take a glimpse at my Dock every once in a while, and whenever I see a Slack or Airmail badge, I’ll see what it’s about only if I have nothing more important to do. I often completly shut down email and open it right before lunch, or a moment before leaving the office. I won’t interrupt a coding session just to see if my Aliexpress order has shipped or if someone has replied to a Github PR. And it feels wonderful.</p><p>Turning off notifications has been a great thing to do. I feel like I’m more in control over my digital life. I get less interrupted by all this noise, and in the end much less stressed about this constant flow of notifications. I feel happier, but not less “connected”, I just chose to open an app because I feel like it, and not because an algorithm has decided it’s a good time for me to do so. A <a href="https://www.wired.com/story/turn-off-your-push-notifications/">recent article from Wired</a> reports that in 2013, “<em>Apple proudly announced […] that 7.4 trillion push notifications had been pushed through its servers</em>”. Where is the limit between information and spam?</p><p>I hope this trend will develop and people start cutting off notifications more and more. Unfortunately, now that Apple has added SIM support for its Apple Watch, the “notification machine” has become independant, so people will get even more reminders to check on their phone. My advice is try it for a week, and see how much you miss having a device constantly buzzing in your pocket. I bet you’ll feel much better, even after day 3.</p><p>— -<br>Cover image: Gian Prosdocimo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=381f1faa5c2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My hectic sleep patterns]]></title>
            <link>https://medium.com/@fbnlsr/my-hectic-sleep-patterns-b22def546c31?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b22def546c31</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[wellness]]></category>
            <category><![CDATA[sleep]]></category>
            <category><![CDATA[mental-health]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Tue, 07 Feb 2017 14:33:08 GMT</pubDate>
            <atom:updated>2017-02-07T14:33:08.296Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nXLTrvpUVn5dS5I1Lo65jQ.jpeg" /><figcaption>Image by Dominic QN</figcaption></figure><p>A couple of months ago I bought myself a <a href="https://www.pebble.com/">Pebble</a>. It’s a nifty little device which acts as an extension to my phone, directly strapped to my wrist. Thanks to it I can quickly send pre-recorded messages with the press of a few buttons, but most importantly get notifications on new messages, them being emails, SMS or even Telegram messages. Which can get a bit invasive especially when my friend Edouard spams me with Wu-Tang Clan lyrics. All in all, it’s really an amazing gadget and I’m really happy with it.</p><p>Another cool feature is its ability to track sleeping patterns. Thanks to its built-in gyroscope, it can detect wrist movements and deduce if I’m sleeping or not. Granted, it’s not 100% bullet-proof, but it does a good job at giving a broad idea of how good (or bad) my sleeping habits are. And boy they are terrible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*BMkT2HJYAr38lzhtzFhjiA.png" /></figure><p>According to my Pebble, I sleep 7 hours 3 minutes per night on a 30 days average, with an average deep sleep duration of 1h 48m. It’s not <em>that</em> bad, but when you take into account that during a same week I can sleep from 3h 55m one day to 9h 18m another, there’s clearly something really wrong with my sleep schedule.</p><p>My usual “worst” night is the one from sunday to monday, with an average of 5 hours of sleep. My “best” night is usually the one from saturday to sunday, with up to 11 hours (!) of sleep.</p><p>The average human needs <a href="https://sleepfoundation.org/sites/default/files/SleepTimeRecommendations012615%5B1%5D-page-001_0.jpg">between 7 and 8 hours of sleep</a> for optimal functions, which means I have a <a href="http://www.health.harvard.edu/staying-healthy/repaying-your-sleep-debt">sleep debt</a> of about 30 minutes to an hour <em>per day</em>. That’s a cumulated debt of about 4–5 hours per week. On the long run, such deprivation is the cause of stress, weight gain, fatigue, and even diabetes.</p><p><em>“But Fabien, all you need to do is go to sleep one hour earlier, that’s all!”</em></p><p>Yeah, that’s not taking into account the absolutely amazing capacity of the human brain to slack off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*bTWtSBH76EpAH7n5DaUJFw.jpeg" /></figure><p>Getting more sleep has been a goal of mine for 2017. I’ve already taken some steps towards this, removing my tablet from the nightstand and replacing it with <a href="https://www.amazon.com/dp/1421586207/">a good book</a>. But I still need to slap myself on the wrist and stop spending my evenings reading about code or cruising around <a href="https://en.wikipedia.org/wiki/The_Elder_Scrolls_V:_Skyrim">Tamriel</a> or <a href="https://en.wikipedia.org/wiki/Counter-Strike:_Global_Offensive">Dust2</a>.</p><p>I hope to write an addendum to this post soon, describing how my sleep habits have changed, if I ever manage to change them. In the mean time, I’m off to take a nap.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b22def546c31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The table naming dilemma: singular vs. plural]]></title>
            <link>https://medium.com/@fbnlsr/the-table-naming-dilemma-singular-vs-plural-dc260d90aaff?source=rss-e3d4948a81f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc260d90aaff</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Fabien Lasserre]]></dc:creator>
            <pubDate>Wed, 25 Jan 2017 10:53:07 GMT</pubDate>
            <atom:updated>2017-01-25T10:57:19.444Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pz2usDj_CkUuk1S9zV-_g.jpeg" /></figure><p>The other day, while in a planning poker session, the question of the naming of a particular table arose. During that conversation, one of our developers suggested that the table shall have a singular name, while others questioned that idea and thought that every table names should be plural. This led me to ask this question: is there a better choice? <em>Should</em> table names be singular or plural?</p><p>It’s funny to see that despite the fact that there is no clear convention regarding this topic, it is a question that gets asked pretty often, and it is the source of big debates in the DB world.</p><h3>Using plural names</h3><p>Narayana “Vyas” Kondreddi (long-time DBA and SQL Engineer) wrote back in 2001:</p><blockquote><em>Tables represent the instances of an entity. For example, you store all your customer information in a table. Here, ‘customer’ is an entity and all the rows in the customers table represent the instances of the entity ‘customer’. So, why not name your table using the entity it represents, ‘Customer’. Since the table is storing ‘multiple instances’ of customers, make your table name a plural word.</em></blockquote><p>It feels logical, and somewhat “natural”. You store several customers inside a table (those “multiple instances”), so the table should naturally be names customers. It also makes sense when writing an SQL statement. When you want to go through all your customers, you SELECT * FROM customers...</p><p>When using plural name, one can consider a table like a crate containing several items. A crate of apples should be labelled <em>Apples</em>, whether it contains one or a hundred apples.</p><h3>Using singular names</h3><p>The people that advocate the usage of singular names often cite the fact that when pointing at a database record, it feels confusing to use a plural name to describe a single item. Thus, why should you use clients.name when you&#39;re pointing only at one client?</p><p>This is enhanced when writing SQL statements, that suddenly appear more natural. For exemple, SELECT activity.name feels better than SELECT activities.name</p><p>It also avoids confusion of english pluralization which can sometimes be tricky for non-fluent writers. e.g. <em>activity</em> becomes <em>activities</em> while <em>person</em> becoms <em>people</em> and <em>data</em> remains <em>data</em>…</p><p>When using singular names, one can consider using the “set theory” to tables, meaning that any instance in the set is representative of the set, so apple is an Apple set. It is agnostic of how many apples are in the set.</p><h3>What should you use?</h3><p>I personally do believe that a database table is the representation of a collection of items. As such, it should be named using a plural word, since it stores several copies of an entity. Thus, each user is stored inside the users table.</p><p>The only thing that could have made me consider using singular names is the SQL statement point, as it feels less natural to use a plural name for a query on a single item. If you’re bugged out by that point you can still use this simple trick to circonvert that issue:</p><pre>SELECT id, name, description FROM products product WHERE product.name = ‘foo’ AND product.description = ‘bar’</pre><p>It’s even more practical when dealing with more complex pluralization:</p><pre>SELECT id, name, description FROM activities activity WHERE activity.name = &#39;foo&#39; AND activity.description = &#39;bar&#39;</pre><p>If you’re really concerned about writing good looking code that feels like proper english, my advice is to use plural names for tables, but single names for the corresponding entities. As such, for e.g. in Symfony you’d declare an entity Activity as such:</p><pre>/**<br> * @Activity<br> *<br> * @ORM\Table(name=&quot;activities&quot;)<br> */<br>class Activity<br>{<br>...<br>}</pre><p>The table activities stores all instances of the possible object Activity. Thus, when invocating and working with that object it makes sense to use the syntax $activity = new Activity() and $activity-&gt;setName(&quot;foo&quot;).</p><h3>In short</h3><p>If I had to give you one piece of advice though, it would be to this: <strong>be consistent</strong>. Stick to whatever convention you’ve decided, and apply it throughout your project. Use what feels the most natural to you and your team. Having the ability to rely on convention is often a good thing, but there are times when a convention is not needed. What’s the most important is to make a clear choice and adopt it. Of course, it’s also important to keep an open ear to the arguments people could provide that’d make you divert from that choice.</p><p>If you’re still looking for some guidance, here are some other tips you might want to use when naming database tables:</p><ul><li>Use short names for your tables</li><li>Use underscore to separate words (no spaces or camelCase), for e.g. product_dimensions</li><li>Be somewhat descriptive: a table name should represent its content. It’s easier to read client_bills rather than clb</li><li>Use unique names that cannot collude with SQL/RDBMS reserved words (avoid name, order, percent...)</li><li>Do not use the table name followd by “id” (e.g. client_id) as your PK. id is more than enough and everyone will understand</li><li>Use id and not ID</li><li>Actually, never use capital letters in your table or field names. Ever.</li></ul><p>Sources:</p><ul><li><a href="http://stackoverflow.com/questions/338156/table-naming-dilemma-singular-vs-plural-names">http://stackoverflow.com/questions/338156/table-naming-dilemma-singular-vs-plural-names</a></li><li><a href="http://stackoverflow.com/questions/7899200/is-there-a-naming-convention-for-mysql">http://stackoverflow.com/questions/7899200/is-there-a-naming-convention-for-mysql</a></li><li><a href="http://vyaskn.tripod.com/object_naming.htm#Tables">http://vyaskn.tripod.com/object_naming.htm#Tables</a></li><li><a href="https://justinsomnia.org/2003/04/essential-database-naming-conventions-and-style/">https://justinsomnia.org/2003/04/essential-database-naming-conventions-and-style/</a></li></ul><p>Feature image: Eli Francis</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc260d90aaff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>