• So, let’s say you need to add new flag --watch to your script from package.json In this case to “test” script

    "scripts": {
      "test": "jest"
    }
    

    Yes, you can add "test": "jest --watch" to your package.json, but that might be not very convinient, insted you can add this directly in terminal. But mind, that

    $ npm test --watch
    

    won’t work as expected because --watch will be considered as a part of npm command, not jest comman as we would like

    So, what you should do instead is

    $ npm test -- --watch
    

    First pair of -- associates arguments with npm (in our case we don’t need any) and second pair of -- will associate with test command (which is in our case is jest)

    Hope you find this info helpful ;)

  • git in terminal

    Useful flags for git:

    • git log --graph shows logs in graph presentation
    • git pull --ff-only Refuse to merge and exit with a non-zero status unless the current HEAD is already up to date or the merge can be resolved as a fast-forward.
    • git pull --rebase rebase the current branch on top of the upstream branch after fetching
    • git show --output=<file> prints diff to file. Pretty useful sometimes
    • git show <sha> --name-only prints not all changes but file names only
    • git difftool link that’s interesting tool to compare files visually
  • When you are using your mobile data you want to count your precious bytes. And in my case I don’t want to install any 3-d party apps for such a simple task.

    Luckily on MacOS you have nettop command

    nettop -n -m route -k rx_dupe -k rx_ooo -k re-tx -k rtt_avg -k conn_att -k conn_est
    

    …simple like that. It will provide you with enough statistics without any additional noise

    First line will show your usage

    First line will show your usage

    You may read more about nettop here

  • Bookmarking a good article about async/await

  • I have faced the issue on the project. Couldn’t do TDD, because running whole test suite is so slow. No chances to run single test, typescript needs to be compiled, npm install needs happend with each run, we need to build test coverage. I don’t argue, but I need run my test fast in this Red-Green-Refactor cycle. Thanks Myk for help 🤗

  • I’ve recently learnt about typescript decorators and would like to share and also show how you can create loggers easily with decorators

  • Did you know that you can open link in a new tab in markdown?

    [text](https://lanadz.com){:target="_blank"}
    

    TEST this link. This page was created with jekyll using markdown

  • Little nice memories of this week

  • Sometimes you need to have different user names and emails for git for different projects (for example for personal and for work projects).

    In this case you might find the following interesting. So, in general, git related wconfiguration is stored in ~/.gitconfig file and looks like