Skip to content

Instantly share code, notes, and snippets.

[A-Za-z]+(?:(?:-[A-Za-z]+)*)?(?:'[A-Za-z]*)?

Explanation

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:

    [A-Za-z]+
    [A-Za-z]+
    

Summary

  • 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
    

HostName bitbucket.org

@ugultopu
ugultopu / npm packages still print spam, despite having `DISABLE_OPENCOLLECTIVE=true`.md
Last active March 31, 2021 13:34
Possible problems and their solutions while trying to prevent spam on npm package installations.

Summary

  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

  • Go to https://babeljs.io/repl.
  • 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) {

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:").

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:

Question

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?

Answer

  • 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
// Open the Developer Tools, switch to the "Console" tab, copy and paste the following code:
(function () {
for (const element of document.querySelectorAll('div[data-allocation-index]')) {
// Remove all video panes, except the main one.
if (element.attributes.getNamedItem('data-allocation-index').value !== '0') element.remove();
}
})();
// Now, only the main presentation pane must be appearing. To make this pane cover the whole screen

If the Allen key is turning but not grabbing and you think that your socket is rounded or stripped, maybe it is not. Maybe you are using a metric Allen key, instead of an imperial one (or vice versa).

As you know, Allen keys (like many other tools) come in sets. I grabbed the set that came with my tool set, found the largest key that can fit in the socket and tried turning. It was turning but not grabbing. I thought that the socket was rounded. Later on, I realized that there is another set of Allen keys in my tool set. Again, I found the largest key that can fit in the socket and tried turning. This time it worked like a charm.

Turns out, the first key that I tried was from a metric set, where the key was 3 millimetres. The second key that I tried was from an imperial set, which was 1/8 inches (which is 3.175 millimetres). As you can observe, these are "almost" the same size, but being "almost" the same size is not enough. That additional 0.175 mm that is brought by the 1/8 inch Allen key was what was nece