More writing

Everytime year or so I come up with a tired epiphany that I need to write more. The fact is I suck at writing, but it brings me joy.

Despite my affection for trying to get my thoughts out into words. I begin to lack motivation and become reluctant to write after a troll or two. My only other source of feedback is my wife who trolls my sentence structure, spelling, extraneous use of commas and general grammar. Her criticism is constructive and necessary, but is just mixed in with exacerbated sighs, eye rolling and the muttering of pointed education quips.

My new goal is to at least write three or more times every week. There is no objective other than to write whatever I feel like at the moment. One post could be about kids or tech, and the next could political in nature (non-partisan I don’t more trolls). I may push a product I recently purchased that I find useful in my everyday life. This format won’t gain readership as it will be all over the board, but at least I will be writing.

Feel free to give me all your feedback. I want the negative, positive, counterpoint. I just ask your negative feedback be constructive in nature and kind to anyone else who may post feedback.

Note: I went through some old posts and trashed a lot of old stuff that was no longer pertinent, or broken due to third party content in page.

Protecting hardwood floor from my evil office chair

Up until last week I have spent the entire new century struggling to protect our floors from my office chair. The bane of my existence is the stupid plastic mat that always ends up curling slightly at the edges. Just enough to catch your unsuspecting toes (or in between toes) in surprise attack. That produce a four letter tirade that Cinemax censors would even cringe at.

I searched high and low for a better mat that my chair wasn’t rolling off of while I was working. Then a simple Amazon suggestion from out of nowhere suggest wheel replacements. Now I know this seems like an obvious solution. Some of you may have actually even started thinking it before the end of the first sentence. I did not. For well over ten years I have suffered or my floors have suffered. Carpet that was ruined from casters. Hardwood floor that had to be replaced when we sold our house. All due to my inability to come to a logical easy solution of rubber office chair wheels.

Office Chair Caster Wheels (Set of 5)

Angular JS – Combining two http requests into one promise

As developers we often find ourselves doing things we shouldn’t be doing, and putting best practices aside for the sake of a “solution.” In my case I found myself needing data that was not in our API end point, because it was customized to suit another application’s needs. So I had to make another API call to get another piece of data. I initially tried nesting call 2 inside of of call 1’s promise, and it worked for what I needed to do, however that is too much stop and go traffic. So in comes $q.all grabs your two requests in an array $q.all([promise1, promise2]), and then chain your .then(function(response){}) of the requests. Once resolved you data comes back in an array [0] or [1] to do with what you please.

app.factory("fetch_data", ['$http', '$q',  function($http, $q){
        var deferred = $q.defer();
        return {
            getData: function(){
                var promise1 = $http({method: 'GET', url: "/this/url/one", cache: 'true'}),
                    promise2 = $http({method: 'GET', url: "/this/url/two", cache: 'true'});
                $q.all([promise1, promise2]).then(function(response){
                    deferred.resolve({channel: response[0].data,vendor: response[1].data});
                },
                function(data) {
                    deferred.resolve({channel: dummyData});
                });
                return deferred.promise;
            }
        }
}]);

I am mostly writing this for myself, as I know I will surely come back to this necessity once again, but also for anyone who may be looking for the solution to a double API call in Angular JS. Let me know if you have a way to improve it. I am always looking for critique, and other ways to do things.

Mt. St. Helens Trip

After months of rain the skies parted and we decided to take an impromptu trip up to Mt. St. Helens so the kids could see it for for the first time in person. Got to take a little hike from Johnston Ridge observatory hike. Managed to even get a little sunburn.

A post shared by Dan Martin (@thepdxdan) on

A view of Mt St Helens with Mt Adams peaking in on the horizon

A post shared by Dan Martin (@thepdxdan) on

A post shared by Dan Martin (@thepdxdan) on

Cross Country – Mount Rushmore

On day three of our amazing trip cross country we started the day off in beautiful Rapid City, South Dakota. The monument didn’t allow dogs and we had two crazy dogs in tow. My son, Atharv and I made a quick dash through the monument speed reading plaques and snapping off shots as quickly as possible so we could get back to the van before it began to heat up.

A photo posted by Dan Martin (@danmartin70) on

A photo posted by Dan Martin (@danmartin70) on