• The Ally transfer processed. I don’t see it in my BOA account yet, but I should get a large deposit notification soon. I also had $0.02 left in my Ally account so I just submitted a req for that as well.
    • Went through some practice interview questions for js-specific roles (which I’m not applying to). I could answer about half, which I’m satisfied with. After studying, I’ll be able to get most. In any case, I’m seeking a full stack position.
    • Read the tesla 2019Q2 report: https://ir.tesla.com/static-files/1e70a30c-20a7-48b3-a1f6-696a7c517959.
    • Capex = capital expenditure (like overhead). Profit = revenue – capex.
    • GAAP = generally accepted accounting principles.
    • UrthBox was firm on “no” when I requested that they cancel the mistaken order (3mo subscription renewal), which was already shady. I pretended to enjoy their business, threatening the loss of future orders, making the decision to refund me lot easier for them. The agent spoke with his manager and magically found a way to cancel 2/3 of the order. This is a good strategy for dealing with cancellations/fees/etc. Paint the picture as a financial long-term strategy for them, rather than something subjective or political.
      • Make sure to thank them after, even if you don’t plan on continuing being a customer of theirs. Pay it forward, ensure this model continues working. If you ghost them, the threats lose value on the macroscale over time.
    • app.use() requires a middleware function. You do this for express.Router(), but not for something like your models. You just require() those (import them, don’t add them to the express app).
    • 204 = no content. You might get some pending requests on an empty db.
    • Always forget. lsb_release. Then use -h, or directly show version with -d.
    • MERN.
      • One of the reason my devtools network request was not responding (and I couldn’t find logs) was because the service wasn’t started (heh). I had begun the backend app days ago and had not restarted it once I had finished with the frontend. nodemon app.js.
      • Moving on to the redux and state portion.
      • Wrapped the app component in both a router and a redux provider, which has a store that contains reducers. Then you basically tell it that the state is all the articles, have it connect to the db, map the redux state to react props, then display the props (articles, blog posts) in the react component. 
      • There was another part completely missing from the tutorial lol: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/. You need to have mongo both installed and running before it can obviously serve a localhost db, otherwise no data is being saved. Surprisingly …….. no errors from express when starting the app and trying to connect. At least not directly presented to the user in the cli. Yikes.
      • Yup, that was totally why everything was busted. As I suspected above, the hanging requests were due to the backend waiting for db connections that … didn’t exist because there was no db. 1000% times better now, fast, clearer logs, everything.
      • Finished the tutorial, got the baseline working. Now on to customization for my own purposes.
      • Created a proper git repo for the blog and customized it.
    • Remember, onsubmit is an event, the js function that executes when a form is submitted. onload is the same for when the page has loaded.
    • … in js is the spread operator. If you have an object with multiple properties, and you want to create a second object with 99% the same properties, just changing a few of them, define the second one with the spread operator on the first object. obj2 = {…obj1, changedProp: x}
    • Mongo
      • Add key, add apt source, apt-get mongodb-org, sudo service mongod start.
      • Then remember, you can check logs with journalctl -u <servicename>, or look in /var/log
      • 27017 is the default mongo port.
      • Enter shell with `mongo`. Just type `help`. Pretty similar to psql and postgres in general. Don’t need to terminate statements like psql.
      • In the shell, show dbs, use <db>, show collections, <db>.<collection>.find()
      • use <db> the db.dropDatabase() to delete one.
    • moment.js is a great library for datetime manipulation, such as converting db timestamps into something relative to now, like “17 minutes ago”.
    • Backticks in javascript are template literals. You can execute code inside of them, to insert expressions (like variables, or math) into strings.
    • If you’re running the webpack dev server, you’ll see “wds live reloading enabled” in the browser console.
    • React: be careful when using arrays, and assign each element a unique key. This applies to situations where you might be mapping an arbitrary-length list from db.find(), and rendering a <div> row for each or something. React uses keys to make it more efficient about what changed and what needs re-rendering. For all child elements in a component that has a list, give each one a unique id. https://reactjs.org/docs/reconciliation.html#keys. This is usually pretty easy, since the raw data has a db id in most cases that you can just pass through.
    • These tattoos made to look like patches are incredible: https://tattooblend.com/hyperrealistic-patch-tattoos-by-duda-lozano/. Would be so cool to get one of a mission patch. This is my official copyright on that idea.
    • npm prune remove unnecessary packages.
    • Went through all the redux docs and took notes (in a google doc). Makes much more sense in the context of the simple MERN app I just built.
    • Remember the react tab of chrome devtools to help debug and should the whole react virtual dom and everything.
    • In javascript, `new` will execute the constructor when creating an object.