Doug.Instance

Featured image

Lightning and Leadership

Mar 25, 2024 | Leadership leadership
I always thought I was a “natural leader” - until I found myself leading a group on a mountain ridge through a lightning storm. That's when I learned what leadership was really all about: decisions.
Read more →

Be Careful Mocking path

Aug 21, 2023
TL/DR; If you mock path.resolve() in a jest test, it could break any require() or import calls downstream. Best to wrap all calls in a helper method and mock the wrapper instead of path.resolve() so that you don't break anything that actually needs a local path.
Read more →

Handleblog Sneak Peak: Rendering Images in Markdown with marked

Aug 18, 2023 handleblog
This post is a sneak peak behind the scenes of the blog platform hosting the post your are now reading - Handleblog. As I said in a previous post, optimizing code requires knowing what key variables you want to optimize. In the case of this project, I am looking for high WAF (Wife Acceptance Factor). I would like my wife to be able to use this platform and, while she is pretty tech-savvy, she has little patience when it comes to unnecessarily difficult UX. Even though I do plan on supporting WYSIWYG editing eventually, I certainly don't need this yet, so keeping the markdown simple as possible is a great way to maximize WAF.
Read more →

Handleblog Sneak Peak: Excerpt Logic and Markdown Parsing Fail

Aug 18, 2023 handleblog
This post is a sneak peak behind the scenes of the blog platform hosting the post your are now reading - Handleblog. I have talked about the Law of Least Astonishment many times in this blog and probably even more often IRL. A blog behavior that meets this law is to automatically create excerpts for blog posts when listing posts so I set out to write a function to render an excerpt...
Read more →

Code Reuse with Nest

Jun 27, 2023 | Code nestnpmreuse
I am currently working on a new application build which is using Nest. Honestly, I haven't worked with Nest before - mostly because I don't write much code in my roles these days and I don't usually lean towards large, "all-inclusive, " frameworks. Generally, I feel like these frameworks cause people to fall into anti-patterns. However, I like the approach of Nest and it does actually seem to guide adopters into a pretty good structure. A prime example popped up when we needed to reuse our CRUD code in a queue listener.
Read more →

Not Authorized Error Deleting CloudFormation Stack

Mar 27, 2023
Whether you actually read my post on setting up pipelines for AWS SAM or you otherwise figured out it is a good idea to use a specific role for your CloudFormation stacks, there is is a good chance you might stumble on the following error when trying to delete a stack: User: arn:aws:iam::[account ID]:user/sts-role-assumer is not authorized to perform: sts:AssumeRole on resource: arn
Read more →

Handleblog - Dev-Friendly Blogging Platform

Mar 21, 2023 handleblog
I've been hosting WordPress blogs for me and my wife on AWS EC2 for quite some time. While it isn't horribly expensive, it costs more than I really want to pay for two blogs with pretty limited audiences. At first, I started with a serverless blog engine based purely on AWS S3 and markdown with the assumption that this would "work" while using basically zero compute resources since everything would be stored as HTML in S3. Pretty quickly I switched from HTML to JSON and then realized just how much metadata you needed for navigating posts in a blog so I threw out the "zero compute" idea. Finally, I wanted to be able to leverage themes built on static HTML/CSS so I decided handlebars was a great starting point for theming.
Read more →

Sprint from Zero to Hero

Apr 27, 2022
Foxbox performs application development as a service for our clients as a core business offering. These applications are of a known scope, and therefore should executed on a fixed timeline and within a fixed budget. Traditionally, this type of contracting work has used (and arguably gave birth to and fed) the “waterfall” approach to project management. Foxbox has embraced Scrum as our agile (i.e. non-waterfall) project management methodology.
Read more →

Pipelines for AWS Lambda - Part 2: The Code

Nov 5, 2021
TL/DR;One of the great things about AWS Lambda is that you can write your code and deploy without worrying about the hosting environment (kind of). So let's talk about what that code should look like so you really don’t have to worry.BackgroundAs I mentioned in my previous post, the AWS Serverless Application Model (SAM), has made (some) things better about developing serverless functions in AWS Lambda. We are going to create a fairly basic Hello World API.
Read more →

Pipelines for AWS Lambda - Part 1: The Deployment Stack

Nov 5, 2021
TL/DR;Serverless applications are complex and AWS doesn't do much to make setting up pipelines for them easy. I'm going to walk through how to use CloudFormation templates to configure multiple pipelines.BackgroundAs I posted before, Tutorials are (Often) Bad and AWS tutorials are no exception. AWS has a tendency to use the CLI or console for tutorials. While this is a fine way to learn, you would never want to use these techniques outside of a sandbox environment.
Read more →

Pipelines for AWS Lambda – Part 4: Troubleshooting

Nov 5, 2021
TL/DR;It’s best to test Lambda "inside-out" by fist making sure the Lambda works, then the invocation (in this case API Gateway), then external. Pipeline error logging and CloudWatch logging are your best friends for troubleshooting.BackgroundIn this series of posts we walked through the following steps for using the AWS Serverless Application Model (SAM) for setting up a GitHub Actions pipeline for deploying serverless functions written in Node.js.
Read more →

Pipelines for AWS Lambda – Part 3: The Pipeline

Nov 5, 2021
TL/DR;You can create a GitHub Action pipeline with sam pipeline init, but it will be configured for python and feature branches that start with "feature".GitHub Action PipelineThe next step of the tutorial is to run sam pipeline init. Unlike sam pipeline bootstrap, this command does not deploy resources directly to AWS. In the example below, I entered placeholders for the ARNs for the resources created in Part 1, but you can enter these ARNs when configuring your pipeline.
Read more →
Featured image

CodeTender: A Brief History

Jan 4, 2021
I was lucky to be involved in building a micro-services platform with Vasil Kovatchev. Vasil is a great software architect and overall great guy. One concept he introduced was the “bartender” script. The idea was to build a working micro-service with a placeholder name that won’t conflict with any code. The first such template was called “Pangalactic Gargleblaster”. The bartender script replaces placeholders in the code (“Pangalactic” and “Gargleblaster”) and does some other stuff to make the service work with the platform. The bartender script is a bash script and the “other stuff” is…well…more bash script. We were quickly serving up not just Pangalactic Gargleblasters, but also Flaming Volcanos and Tequila Sunrises and Whisky Sours. I fell in love with this concept, but I don’t, however, love the bash script since it is very tightly coupled to our ecosystem. Since node.js is a de facto standard for dev utilities (no offense, Python), I set out to build a CLI
Read more →

Home Assistant and Reverse Proxy on pi4 with AWS DDNS

Oct 7, 2020
The title of this post is a mouthful and that probably isn’t everything. This is going to be a long post about a pretty long technical journey. A few years ago I got a free Amazon Echo and very quickly was hooked. I added Echo Dots in multiple rooms, got some smart plugs to handle some annoying lamps, and eventually added some smart switches and a smart thermostat. A colleague introduced me to Home Assistant and after lurking around in r/smarthome and r/homeautomation I decided to get a pi4 to start playing with HA. After spending a few months playing with the basics (including getting access to integrations with my garage door, vacuum, and phones just to name a few), I decided to start working on adding my SmartThings hub and devices as well as Alexa. This means external access. Since I didn’t want to add another monthly fee to my already crowded bank statement and I have 20+ years of IT experience, I decided to use my brain and existing investments to build a solution.
Read more →
Featured image

Tinpothy: Spirit Guide

Jan 11, 2020 | Running running
Practically anyone who spent any significant time in Gainesville, Florida as either a resident or a student the University of Florida knows “the running man”. Having gone to school in the 90s, when he sported dreadlocks, we called him “the Rasta Runner”. He was a mysterious man who could be seen running, seemingly constantly, hands extended in front of him making the “peace sign” with both hands at as many passers by as possible.
Read more →

Don’t Dispose Your Own EF Connections

May 23, 2019
I’m working on upgrading a framework to dotnet core so I am moving from .Net 2.x conventions to netstandard 2.2. Our code was using DbContext.Database.Connection to get DB connections for custom SQL. I needed to switch to DbContext.Database.GetDbConnection(). I made the wrong assumption that GetDbConnection() was a factory method and returned a new connection every time. Therefore I made sure I was disposing of each connection. Tests immediately started failing with “System.
Read more →

Orlando Code Camp 2019 – Little Services, Big Apps

Mar 30, 2019
Today, I was fortunate to present on microservices at Orlando Code Camp. I think this was my 5th straight year speaking at Code Camp, but it has definitely been long enough that I am now not sure ow long it has been. First of all, I'd like to thank the folks at the Orlando .Net Users Group for inviting me back to speak yet again. More so, I would like to thank the great group that showed up to hear my presentation, "Microservices – Little Services, Big Apps".
Read more →

Welcome to the Club, Will Smith

Mar 30, 2019
For the first 5.41 (give or take) miles of my last 10-mile run, I was pissed at Will Smith. That morning I watched (parts of) a video of him attempting to run a half marathon after only 3 weeks of training. Somewhere in the middle of mile 10, after over an hour and fifty minutes of running, Will started to walk. He "failed" surprising…no one (at least no one who has ever attempted a half marathon). Anyone who has ever laced up their shoes in preparation to run (or walk) a half marathon knew this only had 2 possible results: 1. Will Smith's workout routine included enough aerobic exercise that he could run 8-10 miles at an easy pace before he started his "3-weeks of training". Or...2. He would fail.
Read more →
Featured image

Tabs ARE Better Than Spaces?

Jan 31, 2019
For a few years, I've been working with a team that prefers spaces to tabs. More specifically, 2 spaces. I agree that this is a superior visual arrangement and having everyone use it benefits those of us who prefer it, those who don't care, and will eventually bring those who don't like it to see the light. Today, however, for reasons that will be more obvious in future posts, it occurred to me that tabs may actually be superior.
Read more →

Tutorials Are (Often) Bad

Jan 22, 2019
Yes, that is a broad generalization. Yes, broad generalizations are (often) bad. Yes, I see the irony in that. However, tutorials are often bad. The good news is, this is often by design. Tutorials are intended to show you how to do something very specific. This means most basic tutorials are intended to show you how to do that specific thing as succinctly as possible. The problem (or potential problem) with this is that good code is often not particularly succinct. As I mentioned in my previous post, "optimal" code isn't easy to design and what is "optimal" for one scenario might not be fore another. So in this post, I'm going to explore some concepts that are (often) good. Since they are often not followed in tutorials, it stands to reason that tutorials are (often) bad.
Read more →
Featured image

The Science and Art of Code Structure

Jan 12, 2019
Clearly, I should have been in game development. I've been coding since the third grade so software was always in the cards for me. I have a degree in Mechanical Engineering so I have the physics chops to handle pretty much any kind of real-world simulation from projectile motion and particle physics to fluid dynamics and even heat transfer. My masters degree is in Industrial Engineering so I know about things like optimization and simulation that are helpful for AI (among other things). And games are fun!
Read more →
Featured image

Eminence Imminent

Jan 6, 2019
After spending nearly 20 years working for a defense contractor, I joined Deloitte to focus more on software and to build that software for clients outside of the defense business. I've been with Deloitte for a few years now and Im starting to take a more active role in Systems Design and Engineering leadership. This means helping with activities to establish "eminence" of our practitioners. For me, that means being more active in those activities myself…practicing what I preach…eating my own dog food…I think you get the point.
Read more →
Featured image

A Bad Metaphor

Nov 24, 2016
Most people reading this have probably heard the metaphor comparing something to a marathon as opposed to a sprint: your education is a marathon, not a sprint; your career is a marathon, not a sprint; investing is a marathon, not a sprint. At first, the meaning seems obvious. A marathon is 42,195m (26.2 miles) and sprints are 400m or less. You don't have to be good at math to see that the marathon is more than 100 times longer. The marquis sprinting distance is 100m and is used to crown the “world's fastest” man and woman. Both cover the distance in less than 11 seconds. Both marathon world records are over 2 hours. The Disney Marathon requires you maintain a pace of 16 minutes per mile which will get you to the finish line in a few seconds less than 7 hours. A marathon is much longer than a sprint. I get it. Or I thought I did until I finished my first marathon.
Read more →
Featured image

Stop Saying "13.1 Marathon"

Aug 13, 2014
The latest foray into the commercialization of running is the Michelob ULTRA 13.1 Marathon Series. I like beer. I even like Michelob. I like running. I accept that for-profit race series exist. So why should this be offensive? Quite simply, 13.1 miles is not a "marathon". It is a half marathon. A marathon is 26.2 miles. I understand other races are named by their distances. No one is confused or offended by someone saying 5k or 10k, but also no one familiar with running would call those races a "5k marathon" or "10k marathon".
Read more →
Featured image

Look for Horses, Not Zebras

Apr 29, 2014 | Coding debuggingzebras
I have two quotes from old friends that have stuck in my head in certain situations. The first is, "dancing is like standing still, only faster." As a runner, I have adapted that to, "running is like falling down, only slower." The second is, "when you hear hoofbeats, think of horses, not zebras." As a programmer, I have found there is not much better advice than this second quote.
Read more →
Featured image

38th Annual Marine Corps Marathon

Oct 28, 2013
..This was my first "destination race" so that added some additional excitement. My wife and I flew into Baltimore on Friday and spent some time with friends. I did a 2-mile shake-out run Saturday morning. Since all of my training was in flat Orlando, this was my only really hilly run of all of my training – something that I would later regret. The rest of Saturday was pretty hectic. My wife and her friend were staying in Bethesda the night before the race so we had to check into that hotel. Then we went into DC to check into the hotel I was staying in. We finally got some lunch around 3:00 PM and then headed to the expo to get my bib. ...
Read more →
Featured image

Preparing for the Big Race

Oct 24, 2013
So you've paid your registration fee, trained for months, booked flights and hotel rooms, and now you are ready for your big race. Race day is approaching. What are all of those things you need to remember to avoid major running catastrophe and the little annoyances that could have been avoided? I figured I would share my list in hopes it might help out some others. Post your additions in the comments.
Read more →

An Inconvenient Possibility

Oct 15, 2013
Running a marathon is a bourgeois thing to do. Let's face it – people working two jobs to keep a roof over their head and food on the table aren't thinking they need to spend hours every week running to nowhere to get some sense of accomplishment. They are apparently likely to drive by and yell, "run Forrest!" as one random gentleman did just this very morning. I recently had the misfortune of running by a young man who was so offended that someone was running for exercise (or whatever it was I was doing) that he felt obliged to yell at me as long as I was in earshot. I get it. Running is a pretty ridiculous thing to do. It has, like most ridiculous things tend to do, placed me at a strange sort of nexus of the universe.
Read more →

15th Annual Miracle Miles 15k

Sep 21, 2013
This race was a bit of an afterthought. I needed to run 10 at marathon pace this weekend so when I saw this race I figured 9.3 was close enough. I've done this race 2 of the last 3 years and it is one of the few long races in Orlando so it's one I like to do.
Read more →

Why Boston Matters

Apr 16, 2013
As yesterday's tragedy is reviewed in excruciating detail, I wanted to try to give my non-running friends some perspective. Yes, the Boston Marathon is run on "Patriots Day". Yes, yesterday was "Tax Day". Yes, the marathon was a worldwide event with lots of spectators. For people who have no concept of what it is like to run a marathon, they must all seem the same. I'm sure you realize Boston is important the same way you know the Masters, Wimbledon, and the Daytona 500 are important. But the Boston Marathon is different.
Read more →

Galen Rupp – Perfect 10k?

Mar 9, 2013
After reading "That Pre Thing" in the latest "Runner's World", I had the inevitable response – I wanted to race. I wanted to push myself to see what my guts could get me that my training couldn't. With no races on my schedule, I did the next best thing – I watched other people race on YouTube. I started with the David Rudisha 800m world record in London. I wasn't watching Rudisha. I was watching Nick Symmonds. After reading the RW article, I wanted to see him overachieve and PR. I wasn't a fan during the Olympics. The word "douche" was more likely than "idol" to come to mind. After reading the article, though, I have a lot of respect for him and what he is trying to do for competitive running in the US.
Read more →

Have I Arrived?

Jan 4, 2013
When I ran my first 5k, the winner ran it in 19:xx. I remember thinking, "I could do that!" Almost 4 years later and I realize two things: that time won't win a lot of 5ks, and it is pretty fast for a guy my age. Now, after two excellent rounds of half marathon training with increasing pace, breaking 20:00 might be possible. "Might."
Read more →

Disaster Averted

Nov 8, 2012 | Running
As I sat at the kitchen table this morning getting ready for my run, I picked up my phone and surfed the Internet. I quickly realized that I was delaying my run, not because I didn’t want it to start but because I didn’t want it to end. This was my last workout at the end of 18 weeks of training for this year’s Wine and Dine half. It was 18 grouling weeks through a typical hot and humid FL summer. I ran through injury and heat and came out stronger.
Read more →