Sep 29ack = grep for programmersI’ve recently found ack which seems like an interesting tool that can, in some situations, save a bit of time. $ sudo zypper in ack (or whatever your package manager or means of installing new software is) The man page says: NAME ack — grep-like text finder SYNOPSIS ack [options]…Tools2 min readTools2 min read
Sep 13Code Coverage In Different ToolsHere’s a short rant about code coverage. I have a project in TypeScript. It’s a tiny tool to calculate code coverage from LCOV files. I’ve written unit tests to check it’s functionality and handling of various types of data. …Code Coverage2 min readCode Coverage2 min read
Sep 3Quick Tip: refactoring.guruHere is a quick tip if you want to become a better coder. Refactoring.guru is a great resource for learning about refactoring or design patterns. There are some free resources and two paid courses about the two topics. I’ve bought the one about refactoring and it’s worth the price. Enjoy…Coding1 min readCoding1 min read
Jan 21Scopes and Variable Shadowing in JSIf I give you the following example code: const age = 30; function func() { const age = 31; console.log(age); for(let i = 0; i < 2; i++) { const age = 32; console.log(age); } } func(); console.log(age); What will be printed to the console? Try to answer before you…JavaScript2 min readJavaScript2 min read
Jan 19Postman — Covert String to base64Sometimes you need to get base64 encoded string inside Postman. Or decode a base64 encoded string. I think two easy ways are: const base64encoded = btoa('stringToEncode'); // c3RyaW5nVG9FbmNvZGU= const decoded = atob(base64encoded); // stringToEncode Another way to encode might be: Buffer.from('stringToEncode').toString('base64'); // c3RyaW5nVG9FbmNvZGU=Base641 min readBase641 min read
Jan 18Get All NPM Scripts from package.jsonWhen working with package.json files, I often need to get all scripts to find the one I want to run. To do that, I can either open the file and find the script I need, which is slow, or I can use jq to get all the NPM scripts right…NPM1 min readNPM1 min read
Jan 2Send Mocha Test Result to New RelicI’ve talked about Mocha test results a few times — in Mocha JSON Report(er) and Cache Mocha Test Results And Run Only Failed Test Files On Re-runs. Today I’ll add one more piece — sending Mocha test results to New Relic. New Relic is a monitoring platform that can gather…Mocha3 min readMocha3 min read
Dec 26, 2022Cache Mocha Test Results And Run Only Failed Test Files On Re-runsMocha can generate a JSON file with test results. It might be sometimes useful to find all failed test files, e.g. when I want to re-run only tests from such test files. Running all automated tests might be time-consuming, so you might want to look for various ways to run…Mocha5 min readMocha5 min read
Dec 25, 2022Keep Git Authors in Order With GitmailmapGitmailmap is a good way to keep the git authors in order. The official git documentation says: If the file .mailmap exists at the toplevel of the repository, or at the location pointed to by the mailmap.file or mailmap.blob configuration options (see git-config[1]), it is used to map author and…Git2 min readGit2 min read
Dec 24, 2022Channel Notifications Are Not Always UsefulI see a lot of content online about creating channel notification about the results of automated checks. I don’t think this is as useful as such posts sometimes try to portray. What I have experienced is that there’s usually too many (Slack) channels that it is impossible and ineffective to…Data1 min readData1 min read