Skip to content

Instantly share code, notes, and snippets.

// tax lot - each group of purchases
// long term, what price you bought at
//portfolio of tax lots
// relief fifo, lifo, least tax liability, highest cost
// sellList array of objects
// return new portfolio
// highest cost
function checkAnagram({word1, word2, anagramMap, alreadyInMap}) {
let isAnagram = true;
if (word2.length === word1.length) {
for (let j = 0; j < word2.length; j++) {
let current = word2[j];
if (word1.indexOf(current) === -1) {
isAnagram = false;
break;
}
}
function EmployeeGraph() {
this._nextEmployeeId = 0;
this._employeeGraph = {}
this.allowedWriteFields = {
employee: ['firstName', 'lastName'],
organization: ['workEmail', 'jobTitle']
}
this.allowedReadFields = {
employee: new Set(['firstName', 'lastName']),
}
@MattGoldwater
MattGoldwater / node_module_resolution_explanation.md
Last active December 17, 2019 22:04
Explanation of node's module resolution system

When you import a module, Node first checks to see if you imported a core node module such as fs or http.

import fs from 'fs';

Then it checks to see if you've entered a path to a file. Lets pretend we have a file named app.js.

import App from './app';

My definitions below refer to how these terms are most commonly used in the context of software engineering.

Package 

A folder that contains any number of files and folders. It's not just a folder because it must include one file with a standard name. This file varies depending on the package manager and language. For example, npm requires this file to be named package.json. If you're using python its typically _init_.py. 

The contents of the required file aren't standardized across languages or package managers. Typically, this file makes it it easier to use the package. 

A package.json file typically will contain information such as who created the package, who else is allowed to use the package, what other packages must be installed to use the package and scripts typically to run the program, run tests and more. You can read npm's package.json docs here.

My interview of myself

by Matt Goldwater

he rocks

disclaimer I'm biased

my name *Matt Goldwater* is surrounded by asterisks yet its not in italics thanks to the escape character.

email me at mattgwater@gmail.com

i'm going to write some random
words here