Tuesday, July 30, 2019

  • Sick special model of the 2019 panigale v4 to honor the 25 year anniversary of the 916: https://www.ducati.com/us/en/bikes/panigale/panigale-v4-25-anniversario-916.
  • Remember CORS = cross origin resource sharing.
  • JS has a standard lib just like python, of course. For example, process.env.PATH is sys.path.
  • === is strict equality, where it checks type and value. 3 == '3' would return True but 3 === '3' would not.
  • Remember for permission denied errors, make sure you're the owner. sudo chown -R $USER <path>
  • Just like python, if you sudo npm i -g it's going to install it into your system packages with root perms, so subsequent global installs without sudo will fail on permission issues.
  • Stack overflow offline for maintenance a little today.
  • MERN app.
    • Express is pretty similar to flask. Instantiate an app, then add everything to it: models, routes, csrf, cors, session, whatever.
    • Again, nodemon is the library to have an auto restarting express app. Just like flask debug=True and autoreloader=True.
    • Kinda like blueprints, you can abstract all your views to another file using another package Router.
    • .param is a way of specifying information about a request, kinda like running a preroute to look up info in the db and then attaching it to the g object in flask. The param itself is defined in a separate function and then any route can use it with :param.
    • Remember .then and .catch for a function call (.catch = except: and .then = else: although you usually just put the after-success logic at the bottom of the try clause).
  • RAID, parity bits, redundancy across drives.
  • const { property_name } = obj is the syntax for destructuring in es6. You can redefine object attribute(s) to new variables.