Posts

Setting Up Your Angular CLI App to Generate Code Coverage Reports Any Time Tests Are Run in a Workspace with Multiple Projects

I currently do development in an Angular CLI application that contains multiple library projects, and recently enabled code coverage reports to be generated automatically every time unit tests were run. This consisted of 4 steps: Turn on code coverage for each project. Exclude the libraries from coverage in projects that utilized them (each library has its own coverage). Set the output directory for each project's code coverage report to a sub-directory of the code coverage directory to avoid overwriting files for each report generated. Make additions to ignore the code coverage directory from source control. Here's each of these steps in detail. Step 1: Turn on code coverage for each project In angular.json , go to the architect/test/options  node for each project and add a property called codeCoverage  if it's not already there. Set the value to true , as shown below: "test" : { "builder" : "@angular-devkit/build-angular:...

How to Set Who Gets Notified When a Data Extension Import Occurs in Marketing Cloud

Some time ago, I created a data extension in Marketing Cloud and somehow set up a way to get an email notification when one of our scheduled processes kicked of an import. But recently, for the life of me, I couldn't figure out how I set up the import notification part, and I was unable to find the setting in the Marketing Cloud UI. Finally, with a little Googling, and by narrowing down what I was searching by, I found it. Here's how you can set the email address to have the Data Extension Import Notification sent to.  Hopefully this can help someone else in the same situation. 1. From the main Marekting Cloud dashboard, select Contact Builder under the Audience Builder menu. (While I had been trying to figure all of this out I had been looking at the Data Extension configuration, and then tried looking for the Import Definition -- I couldn't image it would be under the Contact Builder  section.) 2. Select Imports from the top nav bar. 3. Find the import definition...

How To Set Up Extra Application Initialization in an Angular App

Image
Angular includes a constant called APP_INTIALIZER. As of the time of this writing, the Angular docs page on it looks like this: I'm pretty sure they've updated the page since the first time I looked at it, at which point it said even less than what is shown above. And even the expanded documentation above isn't exactly clear as to how to use this. So I'll elaborate. In your app's module file, you can declare a provider that provides APP_INITIALIZER . And you can tell it to use a certain function via the useFactory property. For example, in my app.module.ts, I import my environment constant which contains environment-specifc config settings, and I've declared a function called initializeApp()  which initializes my AppConfigService  with envrionment : import { environment } from '../environments/environment' ; export function initializeApp ( appConfigSvc : AppConfigService ) { return () => { appConfigSvc . init ( en...

Getting Moment.js to Work with Angular 6 and Higher

One of the reasons I blog here is so that I'll have an easy way to find things I needed to figure out, so that I don't need to figure them out again . And I really do need to keep that in mind. Today, a co-worker of mine asked me for help getting Moment.js to work with an application using Angular 7. Before I could find a solution, he found one already in the code in a different area. When I looked at the file in question, I'd written it (sigh). I didn't remember the problem (or the solution) until seeing the file again. At the time, I'd been trying to get Moment.js to work with Angular 6 . Here's the simple solution: //Moment doesn't want to behave in Angular 6. Here's the workaround. import * as moment_ from 'moment' ; const moment = moment_; And then you just the use moment  constant like this: Example: payload.birthDate = moment(profile.birthDate).toDate(); I think I probably found this solution on Stack Oveflow, so I c...

I Love The Cheesy Hallmark Channel Christmas Movies

(Updated 12/2/2018) I have a soft spot for TV, movies, and music that are considered...let’s say less than the best . Sometimes entertainment that is unintentionally bad is more enjoyable to me than something comparatively decent. And the Hallmark Channel Christmas movies fit that bill for me. Are they bad ? Well, not really. But they’re incredibly cheesy (IMHO). I watched them every chance I had during last Christmas season, and this year I plan to do the same. Here are the reasons I find these movies so cheesy, and why I love them so much. They’re essentially Lifetime  movies - Okay, now stay with me here. There’s nothing wrong with Lifetime  movies, and I don't want to give you the wrong impression. It's just that these movies follow the same general formula: the lead character is female (either a professional or a small business owner), the story deals with romantic relationships, and the male lead is unrealistically perfect and the type of guy that makes us real-li...

It Came From the '70s: The Ethel Merman Disco Album

Image
From the "Who Really Thought This Was a Good Idea?" department comes The Ethel Merman Disco Album . I went spelunking for bad albums a week or so ago and found this, released back in 1979. I'd heard of it before but this is my first time listening to it and...gee, where to begin? According to  the Wikipedia article , each of the songs was recorded in just one take with Ms. Merman's usual vocal arrangement, with the disco instrumentation added later. Also, there were apparently 14 songs recorded for the album, of which only 7 made the cut (with an additional being included with a CD reissue). That means there are 6 unreleased songs from this. I'd love to hear them. The album is available on iTunes, but without the CD bonus track. The album is typical of the genre, if that genre is Celebrities Releasing Music Outside of Their Wheelhouse . In some cases music itself is outside of the celebrity's wheelhouse, but Ms. Merman was an established singer. Still,...

“Speak, Centurion.”

Image
I have a friend who likes to send me random things through the mail from time to time, the most recent of which was the Imperious Leader  action figure from the original 1978 Battlestar Galactica  shown above. I decided to bring it to work and put it in my office. One day, after returning to my office from a meeting, I found that someone (my boss, it turns out) had constructed a throne for him using two paper cups. It’s surprisingly film-accurate, IMHO. My boss later admitted that he considered coloring it black with a marker but decided it wouldn’t be a productive use of time.