Skip to main content

Brandon Bohling

Tag: coding

Deploying Angular Using http-server, Nginx, and PM2

Since it took about an hour to put all the pieces together correctly I thought it best to document how I deployed an Angular (version 2) app using http-server, pm2, and nginx. In my case I deployed to an Ubuntu server hosted on DigitalOcean, but these instructions should work the same as long as you have the other components installed correctly. I am not an expert on this topic. Like most people, I am learning as I go.

A Useful Desktop with Ubersicht

Ubersicht is an OS X utility that allows you to display dynamic (or static) content on your desktop. In the screenshot below I have some static content for a color palette and Git commit standards; all text being selectable. Possibly more interesting though are the other widgets that are always changing. Take the two Strava widgets at the bottom of the screen. One widget allows me to quickly see how my 2016 cycling compares to 2015 and the other just displays some key data from the current year.

Forgotten Step

Even though I have probably set up a new Mac at least a dozen times in the last few years I keep forgetting the most basic step in the world of Terminal…creating a .bash_profile and adding an export path. This is key because it tells Terminal where to look for executable binaries. Hopefully writing the steps down will make sure I never forget this again. Open TextEdit (or your favorite text editor) Add export PATH="$HOME/bin:$PATH" on the first line Save in your home directory (~/) as .

Parallels and Visual Studio Issue

After months of experiencing Visual Studio 2012 (running inside Parallels on my Mac) hanging when trying to exit out of the app I took a few minutes to look for a fix. Within a couple of minutes I came across this thread which contained the solution to the issue. Based on the thread it seems like the root cause of this issue is that I am working on solutions that are stored on my Mac, \\psf\Home\pathToSoltion rather than working on solutions that are on the Windows (VM) C drive.

Android's Drop Down Bug

On and off for several days now I have been trying to fix an issue where a drop down list (<select> tag) seems to be disabled on old (version 2.x) Android devices. Apparently this is a known bug with plenty of suggested fixes. Not a single one (or combination) worked for me. I even came across this suggestion since we are using iScroll, but it did not help either. What was my solution?

Remove Day Part of Date in URL

Since everyone is talking about shipping these days tonight I took the plunge and released my modified blog on a new server. I have been dreading this day because a) the redesign is incomplete and b) there are so many steps in cleanly moving a domain between providers. Of course, immediately after “flipping the switch” I realized that my old website used URLs like /2011/09/25/Ellie/, but my new configuration was setup to use /2011/09/Ellie/ (notice I no longer have a day in the URL).

Underscore Your JavaScript This Moment

Up until last year it had been many years since I had been a full-time developer. After a year back in the code, I still do not feel as competent as I felt in my prime. So maybe what I am about to share is common knowledge among the developer community, but just in case… If you are developing solutions using JavaScript I highly recommend you check out two helpful libraries: Underscore and Moment.

Configuring Homebrew in a Multi-User Setup

My MacBook Pro is setup with two user accounts: one for personal and one for work. This is certainly not my setup of choice, but if I want to use my own MBP (which is retina) at work then I have to abide by this rule. Anyway, this setup caused an issue when I went to do something that required Homebrew. After a little research and testing Leif Hanack had the best answer.

Count Lines of Code in a Visual Studio Solution

At work I was wading through a very old code base and was curious how many lines of code it contained. Not wanting to open the seemingly endless list of files in the solution, I went looking for a quick-n-dirty way to count the lines of code in the solution. Preferring a command-line approach than installing a utility that I would likely rarely use, I found this simple powershell snippet:

Making UISwitch Useful in a UITableView with Groups or Sections

I just had a progasm1. I was creating a UITableView that had multiple groups with multiple rows in each group. Each row had a UISwitch. The intent was to update a price label every time a UISwitch value (on/off) changed. However, figuring out which row and section, trigged the event was not straightforward. After doing some research it seemed like most people were using a hack where they would set the UISwitch tag property to the indexPath.

Network Throttle for iOS Development

All iOS developers must know about this handy-dandy tool by Mike Schrag: speedlimit is a Leopard [works on Lion too] preference pane for limiting your network bandwidth to one of a couple different speeds—768k DSL, Edge, 3G, and Dialup. This is really handy for testing your iPhone app under normal Edge network conditions in the iPhone Simulator. The new version allows you to restrict the slowdown to only a specific set of hosts.

How to “View Source” from Safari on an iPad or iPhone

How to “View Source” from Safari on an iPad or iPhone from Ole Michelsen: Add this (or any other) page as a bookmark Then click here to see the bookmarklet code and Select All → Copy Now edit that same bookmark, paste the code you just copied into the URL and name it something like “View Source” This will most certainly be used. Thanks Ole!