Dev
0001-1-1 | programming | | [reference]
small little compilation of various tools i’ve found to be pretty useful.
node modules
dealing with node modules can often be a pain, but it doesn’t have to be. assuming you’re following the general best practice of not checking in your node_modules
directory into version control, you may forget to add it to your .gitignore
before checking it in. thankfully, there’s a quick solution for such situations:
touch .gitignore && echo "node_modules/" >> .gitignore && git rm -r --cached node_modules ; git status
h/t: https://stackoverflow.com/a/47825219
shuffling nested directories
quick little command to move the contents of a nested directory into the current directory:
mv -v ~/subfolder/* ~/desiredfolder/
h/t: https://superuser.com/a/658084
module.exports
i’m realizing i’m so ridiculously rusty on all things related to node. some resources that helped me navigate best practices around importing/exporting
- have to commit to either modules (< es6) OR explicit imports/exports (es6+)
- good walkthrough
- nice stackoverflow post on navigating between es6 and pre-es6 importing/exporting
web dev
- https://vercel.com/guides/deploying-react-with-vercel-cra for simple deployment of react apps
- https://raptis.wtf/blog/create-a-navbar-with-chakra-ui-react/
- https://www.coffeeclass.io/articles/create-responsive-navbar-using-chakra-ui
nextjs
- getting query params
- nextjs express template
- https://dev.to/alexeydc/express-nextjs-sample-tutorial-integration-485f
- https://github.com/vercel/next.js/tree/canary/examples/api-routes
- https://github.com/vercel/next.js/blob/master/examples/api-routes-middleware/pages/index.js
- https://nextjs.org/docs/api-routes/dynamic-api-routes
infra
- blue/green deployments: keep two identical environments so you can cug over from one to another