Skip to content

Instantly share code, notes, and snippets.

View How to always show TypeScript (compilation) errors on a Visual Studio Code project?.md


I would like a way for Visual Studio Code to always show me which TypeScript files in my project has an error. I would like these shown to me on the problems gadget on the bottom status bar, as well as represented with a red font and a red dot in the file explorer view on the left side. How can I achieve this?


  • Make sure you have a tsconfig.json file at the root of your project. The contents of it does not matter, it can be just an empty file. All that matters is that it is present, so that, as far as I can tell, Visual Studio Code will be able to tell that this is a TypeScript project and hence, it will enable the built-in TypeScript extension for the project.
  • Press CMDSHIFTp, type "task" and select "Tasks: Run Task".
  • Type "watch" and select "tsc: watch - tsconfig.json". That is, we're running a task named tsc: watch, which comes from the tsconfig.json file (where, in reality, it simply comes from the built-in TypeScript extension in Vi
View Generate diagram from existing

Most useful search term for this is "reverse engineer database". Or "generate diagram from SQL" (such as using a database dump to generate a diagram).

The only programs that I found to be working among the ones that I tried are:

Other programs that are mentioned around the Web:

View How to sort the files by last modified (or by any other criteria) in macOS open file dialog box?.md

Instead of normally clicking on the "Change the item grouping" button, press and hold the Option key before (and while) clicking it. This way, the drop-down menu that opens will be for sorting items (it will say "Sort items by:"), instead of for grouping items (instead of saying "Group items by:").

View Understanding how new ECMAScript features work by observing Babel's transformation
  • Go to
  • Remove (delete) everything in the "targets" section.
  • Expand the "env preset" section and enable it.
  • In the "env preset" section, select (enable) "loose". This way, at the expense of generating code that is not 100% spec-compliant, Babel will generate code that is as clean as possible. This way, it is easier to have an idea how a new ES feature would be implemented in old versions of ES.

For example, for the input:

class Human {
  constructor(firstName, lastName) {
ugultopu / npm packages still print spam, despite having `DISABLE_OPENCOLLECTIVE=true`.md
Last active Mar 31, 2021
Possible problems and their solutions while trying to prevent spam on npm package installations.
View npm packages still print spam, despite having `DISABLE_OPENCOLLECTIVE=true`.md


  1. Make sure you also set OPENCOLLECTIVE_HIDE=true. Some packages check for this one and not DISABLE_OPENCOLLECTIVE, while some others check for DISABLE_OPENCOLLECTIVE and not OPENCOLLECTIVE_HIDE. Hence, set both. Note that in the future, you might encounter another package that does not support any of these variables, but some other ones. In that case, update this list.

  2. You (most likely your package-lock.json file) has an older version of a "spammer" package. This older version does not respect the "no-spam" environment variables such as DISABLE_OPENCOLLECTIVE=true, because it (the older version) is missing the code ("logic") that checks for the presence of these "no-spam" environment variables and omits printing the spam messages in the case of their presence. The solution is to update ("upgrade") your package-lock.json, so that you

View How to configure multiple SSH keys for the same website (domain)?.md


  • Create a new SSH key pair by running ssh-keygen.
  • Add an entry like the following to your ~/.ssh/config file:
    # The value of the `Host` below (which is the "title" of the entry)
    # can be anything. However, it is better to use a descriptive name
    # like "bitbucket-yourCompanyName" instead of the less descriptive
    # example "someNameThatYouChoose" below.
    Host someNameThatYouChoose
View Regular expression that matches an English


On each item, first line of code represents the regular expression that expresses the description and the second line represents the cumulative regular expression.

  • A sequence one or more letters:

View Find the length of the longest string in array of strings.js
(max, string) => string.length > max ? string.length : max,
// Or, more verbose version:
(max, string) => {
if (string.length > max) return string.length;
else return max;
View docx files are actually just compressed (zip) XML

Opening a .docx file on a text editor won't mean anything, because a .docx file is a compressed file. To access the content in a .docx file, you can decompress it by running:

unzip path/to/file.docx

The better thing would be to create a directory and then run the command, in order for all files to be extracted to the same place:

mkdir document-contents
cd document-contents
unzip ../path/to/file.docx