When I first started really digging into advanced Comp Sci topics, graph theory and recursion were two that I felt like I’d never get. Like most things, though, it was just a matter of time and practice before I felt at least a little more comfortable with them.
Today I worked through an especially tough challenge. Here it is:
Write a Node.js program that, given a relative directory path, will return a list of all files in all folders and subfolders inside of that directory.
For example, imagine a directory tree:
| |-- foo
| | |-- a
| | | +-- Hello.txt
| | | +-- World.txt
| | |-- b
| | | +-- Dude.js
| | |-- c
| | | +-- Sweet.js
| | +-- hey.js
| |-- bar
| | +-- baz.js
| +-- ho.js …
Everyone knows that gracefully handling errors in your application is important. But sometimes, especially when you’re developing at the startup pace, it’s easy to put it aside for later while you work on… well, getting things to work.
I finally got a chance to start refactoring an application I built a few months ago. Among many sweet-baby-Jesus-did-I-actually-write-that-awful-code? moments, I noticed that my error handling was generally pretty weak — a popup here or console.log there. Now with a couple more months of experience under my belt, and a much stronger understanding of OOP, I knew I could better.
First, I wanted to identify common elements in error handling so that I could keep my code as DRY as possible. Here’s the list I came up…
Today I tackled a tough problem — file uploads with MongoDB and GridFS. The tricky part wasn’t so much the file uploading part, but rather the putting it all together. I found a lot of resources for individual pieces of the puzzle, and figured it’d be good to share what I learned about the whole picture.
I needed to allow a user to upload a pdf file and store it in MongoDB. Later I’d need to retrieve that file and display it on the client again somehow. The app was MEAN stack with Angular 1.5 and the usual suspects. …
(Ported over from my previous blog)
Last week at Coding House, some of us chose to create a web app using React. Our group made a forum for prospective or current students and alumni of dev bootcamps to ask questions and share their experiences. Check it out here.
Listening to some of the frustrations from the other teams as well as working through our own issues during the project, I thought that doing a little Flux flow tutorial would be beneficial. I’ll use Robbie McLellan’s SwordOfTheNinja template to start out, which you can find here. I like to use it whenever I start React projects because it has all the essentials for creating a full stack React app like babel and jspm without any unnecessary sugar. …