---
title: "Blaine Garrett (@blainegarrrett) | Hashnode"
description: "Software Engineer and Artist. Read the latest articles by Blaine Garrett on Hashnode."
url: "https://hashnode.com/@blainegarrrett"
---

@blainegarrrett

# Blaine Garrett

@blainegarrrett · Minneapolis, Minnesota, USA · Joined December 2019

Software Engineer and Artist

[Website](https://www.blainegarrett.com/)

## Comments

[Thanks Chris! I made the correction. However, now that I reread the loading order docs, I'm conflicted if this is accurate. https://nextjs.org/docs/basic-features/environment-variables#environment-variable-load-order Again, I don't use this feature often so I hesitate to dig further at the moment. I tend to explicitly add the NODE\_ENV to my command line args when running the prod build locally but it might be redundant in that next dev is implicitly NODE\_ENV='development' and next start is NODE\_ENV='production'. I'm tempted to see what NODE\_ENV='development' next start produces. I'll have to try it out later. Anywho, thanks again for commenting and I'm glad these articles are still helping folks out after 2 years.](https://hashnode.com/posts/building-a-github-repo-template-part-5-nextjs-environment-variables/5f1204d3b8ea603b4afa1689/comment/6233b5c86647c71acb640ca2#reply-6234a279bef4c71aa6f0e5dd)

Reply · Article · Mar 18, 2022 · [Building a Github Repo Template Part 5: Next.js Environment Variables](https://hashnode.com/posts/building-a-github-repo-template-part-5-nextjs-environment-variables/5f1204d3b8ea603b4afa1689)

[Thats awesome! Just in time to start writing again!](https://hashnode.com/forums/thread/series-enhancements/comment/6047afd465791a53339435e3#reply-6047b66065791a5333943651)

Reply · Thread · Mar 9, 2021 · [Series Enhancements](https://hashnode.com/forums/thread/series-enhancements)

[One thing worth noting is that the HEX color representation is an abstraction of actual color. There are other color representations such as 48-bit color that can represent 281.5 trillion colors and CYMK that uses a 4 dimensional vector. All of these are simply abstractions of the visible light spectrum. Also, the cones in eyes can generally distinguish 100 shades. Color blind people, typically only have 2 types of cones and thus can distinguish 10,000 colors (100x100). Most people are "trichomatic" meaning they have 3 types of cones and can thus distinguish 1,000,000 (100x100x100) colors. This is a far cry from the 16 million colors that can be represented with RGB. Although, some people (women exclusively) have an extra cone that allows them to see a wopping 100,000,000 colors. These people are considered "tetrachomatic".](https://hashnode.com/posts/euclidean-distance-in-n-dimensions-and-naive-image-quantization/5f65145767d51d3b5d47987d/comment/5f809d5f5841661b519cfd09)

Comment · Article · Oct 9, 2020 · [Euclidean Distance in N dimensions and Naive Image Quantization](https://hashnode.com/posts/euclidean-distance-in-n-dimensions-and-naive-image-quantization/5f65145767d51d3b5d47987d)

[Update: In the handleSuccess callback I added a few lines stop the stream. It was a little disconcerting navigating to a new page and having the camera light still on. stream.getTracks().forEach(function (track) { track.stop(); // e.g. turn camera off, etc }); In a future version, I'll store the device stream in a ref and run similar code when unmounting the React component.](https://hashnode.com/posts/accessing-available-devices-in-browser-via-getusermedia/5f6f8ecf0ba48d6624c91a60/comment/5f70b6db531ea76fd9689cc3)

Comment · Article · Sep 27, 2020 · [Accessing Available Devices in Browser via getUserMedia()](https://hashnode.com/posts/accessing-available-devices-in-browser-via-getusermedia/5f6f8ecf0ba48d6624c91a60)

[Today I discovered that the "Rewrites for Static Files" section of this post is not necessary in the above case of robots.txt When I migrated to the the version of Next.js that introduced the public folder, I simply wholesale moved the static folder into the public folder. However, Next.js will attempt to serve files from public folder at the root url of your application. As such, you simply need to move the favicon.ico and the robots.txt into the /public directory and not bother with the rewrites. As an additional test, I added a file to the public directory that would conflict with one of my dynamic routes and Next catches it, which is pretty great.](https://hashnode.com/posts/eliminating-serverjs-with-nextjs-95/5f491110f58b104825f01b9f/comment/5f6e006c60599c596c4723a3)

Comment · Article · Sep 25, 2020 · [Eliminating server.js with Next.js 9.5](https://hashnode.com/posts/eliminating-serverjs-with-nextjs-95/5f491110f58b104825f01b9f)

[That makes sense. I would really love for a native Firebase/GCloud solution as that is the ecosystem I work in even if it requires maintaining a separate dataset in a different FB/GCloud product. This is how I utilized Search API with Datastore for Gen 1 AppEngine.](https://hashnode.com/forums/thread/firebase-team-ama/comment/5f663ee035d6463d2b5f85a6#reply-5f6b8329ff06f53c8bd63841)

Reply · Thread · Sep 23, 2020 · [Firebase Team AMA](https://hashnode.com/forums/thread/firebase-team-ama)

[Is adding full text search functionality to the Firebase product suite on the product roadmap?](https://hashnode.com/forums/thread/firebase-team-ama/comment/5f663ee035d6463d2b5f85a6)

Comment · Thread · Sep 19, 2020 · [Firebase Team AMA](https://hashnode.com/forums/thread/firebase-team-ama)

[Good article. It might be worth mentioning Symbols are also allowed. I've only run into them as object keys in some Google cloud libs. The only reason I like them (conceptually) is that they're harder to manually re-create when constants should be used since each instance is unique. I believe this is their explicit reason for existing.](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f63f13042517c2434461d55)

Comment · Article · Sep 17, 2020 · [JavaScript Quirks: Dot vs. Bracket - Not all notation is created equally](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b)

[Django is a framework and thus you have a lot of builtin functionality, which can be restrictive if you need to stray from what the framework prescribes. Node.js is simply the runtime like "Python" or "Php". Without leveraging frameworks written to run on Node (just as Django is a framework written to run on Python), you have the freedom to build from scratch, however cumbersome that may be. I have not kept up with Django since it's 1.2 release many years ago, but I remember working with their Data model a pain if you needed to use a NoSQL database, for example. Also, I found signals fairly annoying to work with. These things may no longer be an issue. Django was one of the more complete (and thus complex) frameworks I've ever worked with and I have not run across as robust of a framework for Node.js If you are writing python and just need a REST api to serve data, I have been enjoying working with Fast API with Pydantic typing. It would be comparable to running Fastify or Next.js API endpoints with TypeScript on Node.js.](https://hashnode.com/posts/which-one-is-better-for-robust-web-apps-nodejs-or-django/5f60fd227317080b4cf5c5df/comment/5f61cb3ac08f260dbcebe6d3#reply-5f6256f9939cf216bcb350ea)

Reply · Article · Sep 16, 2020 · [Which one is better for robust web apps? Nodejs or Django.](https://hashnode.com/posts/which-one-is-better-for-robust-web-apps-nodejs-or-django/5f60fd227317080b4cf5c5df)

[Since a JSX React component is just a JavaScript function under the hood, much like a JS function, you can assign it to a variable. Then you can call it by reference. The function isn't evaluated at assignment time, but rather at call time. In JSX, the act of wrapping it in the angle brackets implicitly calls the underlying function. Contrived untested example: let myFunc = Math.add; // Not evaluated yet if (condition) { myFunc = Math. multiply; // Still not evaluated yet } return myFunc(...args); // Only now evaluated. Similarly, for JSX let MyComponent = Button; // vs. <Button /> if (conditional) { MyComponent = CustomButton; // vs. <CustomButton /> } // No components have been evaluated yet ... Do lots of other stuff // Component only gets evaluated below return <MyComponent {...props} /> Note: JSX treats variables that start with lowercase names as html element names rather than variables and will error if it is not valid element. I have no idea what this does off hand, but it probably errors // let a = MyComponent // return <a {...props}> I ended up refactoring the table cell renderer code to leverage this concept and conditionally assigned the className and built the props rather than conditionally rendering the JSX.](https://hashnode.com/posts/how-to-avoid-prop-drilling-in-react-using-component-composition/5f1c84e6f4016901885cc45d/comment/5f1dbff4e8630d03fc853d17#reply-5f2050a3ed20ff21a11e77e2)

Reply · Article · Jul 28, 2020 · [How To Avoid Prop Drilling in React Using Component Composition](https://hashnode.com/posts/how-to-avoid-prop-drilling-in-react-using-component-composition/5f1c84e6f4016901885cc45d)
