Tech Notes

Read/Write Files From Directory With Node.js

Tags:

Perhaps you are looking for a way to dynamically read html files and update text on each page, like a file path with a build version number.

React Ecosystem Notes

Tags:

React is a library as opposed to a framework, but the React ecosystem is augmented with different tools to create a full fledged application. For example React does not have routing built in unlike Ember or Angular; React is less opinionated.

Write an AppleScript to boot a Shell Script at Runtime on your Mac

Tags:

Curious how to boot up a shell script at runtime on your Mac? Here's a straight forward approach to writing an AppleScript to accomplish that, that almost anyone should be able to follow. First we will create an AppleScript to startup Terminal. Then we will modify our .bash_profile with an alias command to run a particular script and then we…

The JavaScript Module Pattern, how and why?

Tags:

The Module Pattern in JavaScript was created by software engineers in 2003. The purpose of the module pattern is to emulate objects with private and public methods in a closure that shields internal methods from the global scope and namespace protection from other scripts. The structure of the module pattern is emulates an object literal if you are familiar with…

Automate your dev projects using a shell script!

Tags:

Since most of us in the dev world spend so much time in Terminal/Command Line, why not automate your workflow process by writing a script to get your up and running faster? And if you are on a Mac, let's take it a step further and have Terminal open and start the shell script when you login to your computer.

Node.js - API Promises using the 'got' or the 'async-get-json' package

Tags:
,
There are a few notable npm packages that handle promises with Node.js when retrieving apis. Here's two that I use and in the following snippets Im pinging github's api and returning the promised resolve data.

JavaScript Promise Functions

Tags:

We've all heard the rather annoying buzz phrase "callback hell," well Promises in JavaScript rescue you from this sort of hell and tame the beast so to speak. You can manage when and where async callbacks are happening so you don't have async operations completing at undesired frequencies.

Angular.js - Passing scope from one controller to the next w/ $rootScope

Tags:

Somehow there isn't a clear cut straight forward approach to passing scope from one controller to the next in a typical google search. So here's the solution in just a few lines for code, and an alternate (hacky) way of passing scope from one controller to the next. The short of it is, using $rootScope inside of one controller you…