code

A -post collection

Secure Environment Variables with Travis CI

While building a web app you'll often need to have access to different variables depending on the setup (or environment). For example, your local machine, the staging/testing server, and development servers are all different environments. On each of these environments you might need different settings. On your local machine your app might connect to a localhost database, while staging and development connect to AWS DynamoDB or MongoDB Atlas. Environment variables give you the ability to have different settings across these environments. Environment variables are typically stored in a .env file in your project directory consisting of key/value pairs. On your local machine the .env file contains key/values for your local setup, while the .env on staging and production contain the same keys, but

Read more

1,000,000 People Reached

Stackoverflow, one of the many StackExchange community of sites has been one of, if not the most, influential resources for my coding career. If you're not familiar with it, Stackoverflow is a Q&A-style site for asking and answering questions related to programming. By answering (and asking) questions users earn reputation when their answers (and questions) are voted-up by other community members. There are also badges, earned by accomplishing certain feats - like answering old questions, editing questions, voting on questions/answers and more. Stackoverflow (SO) also has a Jobs section with many of the most highly sought-after employers advertising open positions. My past 2 positions, both of which I've loved, were found through Stackoverflow Jobs, and I receive interview offers nearly every month from

Read more

NPM Package - Git Trim Stash

If you're anything like me when it comes to coding your git stash is likely a bit long. A quick git stash list on any of the repos I'm currently working in will reveal a few dozen stashes. I find stashes extremely useful when experimenting with ideas and I don't necessarily want to completely trash a previous attempt. Stashes are also useful when I need to switch to another branch to make a quick edit but I'm not ready to commit the changes on my current branch. Over time, all of this adds up to an increasingly long stash list, several dozen or more. git has several functions for managing the stash - git stash clear will clear the entire stash, and git stash drop [<

Read more

Side Project: UnlockSwarm.com

I'm a huge fan of the Swarm mobile app. If you're not familiar with Swarm, it's an app for checking into venues, built by Foursquare, that makes your everyday travels into a competitive game. By checking-in to new venus, in new locations, more frequently (among other factors) you earn (virtual) coins, and win the game by outscoring your friends each week. The coins are used to purchase virtual stickers which are used to enhance check-ins. For example, once you've upgraded the Jetsetter sticker using it at Airport check-ins will multiply the coin bonus by 2 or 3 times. Coins can also be used to purchase 'perks' at participating venues. So, you go about your day you check-in to venues via the Swarm app, that's the easy

Read more

Parallel Promises in Node (or how to wrangle multiple Promises)

Promises offer a much easier pattern for handling asynchronous requests. Compared to the callback pattern Promises allow for much cleaner and maintainable code. A common pattern encountered when working with APIs is the need to do several requests at once, and return all the data in a single response. For example: Imagine an app where you've requested users who have Liked a photo on Instagram. This can be accomplished with a GET request to /media/[media-id]/likes. The response will be an shallow array of users: { "data": [{ "username": "jack", "first_name": "Jack", "last_name": "Dorsey", "type": "user", "id": "66" }, { "username": "sammyjack&

Read more