Skip to content

Instantly share code, notes, and snippets.

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:

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

  • 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) {
@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

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

[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]+
    
strings.reduce(
(max, string) => string.length > max ? string.length : max,
0
);
// Or, more verbose version:
strings.reduce(
(max, string) => {
if (string.length > max) return string.length;
else return max;
},

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

As far as I can tell, you can't do it conveniently. That is, git-rebase does not give you an option to preserve the committer date. Unless you give the --ignore-date (or its alias, --reset-author-date) option, it will always preserve the author date. However, there is no way to make git-rebase preserve the committer date, unless some manual script is crafted.

The best you can do is to make the committer date equal to the author date. Recently (in 2020 Q4), git-rebase --interactive has gained the ability to use the --committer-date-is-author-date flag with the interactive rebase. Before that, there was no way of influencing the committer date at all with the interactive rebase. Note that this flag does not preserve the committer date. It merely makes the committer date equal to the author date.

You might be thinking "well, isn't that effectively preserving the committer date, since normally the committer date is always equal to the author date?". Normally, you would be correct. However, there