Today I Learned

  • 8Apr2021

    You can use an emoji as a favicon by turning it into an svg. This is supported by all modern browsers.

    <svg xmlns="http://w3.org/2000/svg" viewBox="0 0 100 100">
      <text y=".9em" font-size="90">😆</text>
    </svg>
  • 2Mar2021

    You can display a GitHub code in VS Code using the open source library github1s. You only need to add 1s after github and press Enter in the browser address bar for any repository you want to read.

    Example:

    //github repository
    https://github.com/mdtarhini/cheat-sheet-maker
    
    //online vs code viewer
    https://github1s.com/mdtarhini/cheat-sheet-maker
  • 8Jan2021

    In Bash, commands which begin with a space character are not saved in the history list. This can be useful if you want to avoid re-executing dangerous commands while accessing the history.

  • 26Dec2020

    In HTML, you can use the loading=lazy attribute to defer the loading of images until the user scrolls to them.

    <img src="path/to/img" alt="alt text" loading="lazy" />
  • 12Oct2020

    In HTML, you can use the attribute autofocus if you want an element to be focused by default. This attribute can be used for <button>, <select>, <input> and <textarea>

    <input type="text" name="input-name" autofocus />
  • 21Sep2020

    The name of the python programming language was inspired by the BBC comedy series “Monty Python’s Flying Circus”.

  • 13Sep2020

    World Wide Web was invented in 1989 at CERN as a way to automate information-sharing between scientist around the world. This is how the first website looked like (link)

  • 9Aug2020

    You don't need Javascript to accomplish smooth scrolling for web pages, there is a native css solution for this:

    html {
      scroll-behavior: smooth;
    }
MohamadTarhini