Gil Creque

Small posts, observations, and updates.

Rearranging for WFH

Did some rearranging of my office area yesterday to accommodate my newish coworkers and classmates. I separated desks and now my side desks sits behind me with my iMac and 3D printer (and my Nanoleaf until I get more command tape). My son’s gaming PC and desk will be in front so we will share this space when he is done with school work. He’ll be in his room during school hours. I have to put together my wife’s desk and put it in the living room where my son’s desk used to be. Anyone else have to make arrangements for better WFH for all?

Returning Observable objects from combineLatest()

In trying to use more Reactive patterns in Angular I have been using the combineLatest() RxJs method to combine several Observables into one Observable and using the async pipe to use the data in the template. This ensures that all of the data is available in the template by using *ngIf. One thing I did not like about using combineLatest() is that it returns an array of results back based on the array of Observables you handed to it. This made accessing this data in the template look messy and made it harder to understand what data you were accessing.

cousePageData$: Observable<[User, Course]>;
const user$ = getCurrentUser(); // get the current user
const course$ = getCourse(courseId); // get course by course id
this.cousePageData$ = combineLatest([user$, course$]);

In the template this would result in array([ user, course ]) as a result of using the async pipe (<div *ngIf="cousePageData$ | async as cousePageData>) and you would have to access user and course using the index on the array (cousePageData[0] and cousePageData[1]). As you can see, this obfuscates what data is actually being accessed at this indexes.

So I set out this morning to get this cleaned up in our repository and found a pretty easy solution in RxJs, using pipe and map to return the results of combineLatest() as an object.

cousePageData$: Observable<{user: User; Course: Course;}>;
const user$ = getCurrentUser(); // get the current user
const course$ = getCourse(courseId); // get course by course id
const cousePageData$ = combineLatest([user$, course$]).pipe(map(([user, course]) => ({ user, course })));

In the template this would result in object({user: userData, course: courseData }) as a result of using the same async pipe and you can now access user and course using the property name on the object (cousePageData.user and cousePageData.course).

Yay for less obsfucation! Let me know if you have any other ideas regarding this!

We have a pandemonium of wild parrots that fly around town. Sometimes they sit outside our office and squak up a storm.

I love catching up with Marc and Lee on Mondays.

Most days: “Doesn’t anybody work in this town?”

Today: “Look all those suckas going to work”

#fieldtrip

My Blender experiment is looking better now. I went back into Graphic and divided the paths into just a handful of layers and layers exported each layer as an SVG. This made combining in Blender much easier. Also, converting to a mesh removed the weird blending problem that was showing up before.

Trying out Blender by creating a 3D model from an SVG. It’s doesn’t look right so far. 🤔

Firebase Summit 2019
- What’s New for Firebase Web?

I gave a lightning talk yesterday at an event I helped organize for GDG Space Coast covering what was new in Firebase for Web Applications from the Firebase Summit back in September.


Adventures in Making Slides

I originally did my slides in Keynote to tryout the transitions that it provides. I ran into an error when my iCloud save presentation didn't sync properly so I was stuck having to redo my slides just before and during the beginning of the event. I went to share them in this blog post and I realized with the videos I included I would need to remake my slides once again. First I had to export the slides as PowerPoint from Keynote as Google Slides doesn't support importing Keynote slides. After I imported I decided to take a look at the branding guidelines Google Developers recently pushed out to organizers of Google Developer Groups. I copied over some of the slides for my intro and thank you slide. I'll have to remember to use the provided templates as a basis for future slides.

Bitbucket Pipeline Failure Deploying to Firebase

Bitbucket Pipeline Failure Deploying to Firebase

After a recent push in our develop branch our Bitbucket pipeline was complaining that it could not deploy to Firebase. The dev team was perplexed because we had built the branch several times locally and manually deployed with no problems. Here is the command we were running:

firebase deploy --token=$FIREBASE_DEPLOY_TOKEN --project project-name --non-interactive

Here is the error we were receiving:

Error: Error occurred while parsing your function triggers. Error: @grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
at Object.
(/opt/atlassian/pipelines/agent/build/functions/node_modules/@grpc/grpc-js/build/src/index.js:47:11)     at Module._compile
(internal/modules/cjs/loader.js:689:30)     at Object.Module._extensions..js
(internal/modules/cjs/loader.js:700:10)     at Module.load
(internal/modules/cjs/loader.js:599:32)     at tryModuleLoad
(internal/modules/cjs/loader.js:538:12)     at Function.Module._load
(internal/modules/cjs/loader.js:530:3)     at Module.require
(internal/modules/cjs/loader.js:637:17)     at require
(internal/modules/cjs/helpers.js:20:18)     at Object.
(/opt/atlassian/pipelines/agent/build/functions/node_modules/google-gax/build/src/grpc.js:37:14)     at Module._compile
(internal/modules/cjs/loader.js:689:30)

We started barking up the wrong tree and thought maybe the version of Node set in our Firebase functions was the issue. It actually turned out to be the version of Node set in our Bitbucket Pipeline YAML. We had recently updated our local dev environments to use Node v10.17.0, the LTS for version 10 of Node (Firebase is maxed out at using 10 for now). We had forgotten to update the Bitbucket image. We fixed it by updating our bitbucket-pipelines.yml in our project like so:

image: node:10.17.0

The new deploy ran perfectly!

I'll be leading 2 events this week

First, on Thursday evening, I'll be going over what new services and tools were announced at Google Cloud Next '19

[www.meetup.com/GDGSpaceC...](https://www.meetup.com/GDGSpaceCoast/events/260008890/)

Second, on late Saturday morning, I'll be leading a Google Study Jam where you can earn Google Cloud badges while learning how to use Google Cloud's services. You'll get access to free training material from Google and access to other free training if you complete the Study Jam material I share.

[www.meetup.com/GDGSpaceC...](https://www.meetup.com/GDGSpaceCoast/events/260474440/)


bat, a Substitute cat Command

While watching Suz Hinton/noopkat's Twitch stream today I noticed that when she ran the cat command it looked a little different than what I was used to. It has some subtle styling to it I had never seen before. I found out from the #noopkrew that it was the bat command, a substitute cat command with some superpowers. I brew installed it immediately and set up an alias to replace cat. Think of it as Apple's Quick Look but for the command line. It does syntax highlighting for several filetypes including JSON and Markdown. It is also git aware and can show diffs in files. Amazing!!

Cutting the Cord…Again

I returned the CableCARD and tuner box at Spectrum to start off the new year not paying for things we don’t use. I also inquired about what Internet only plans were available and, to my surprise, I found out that Spectrum’s Internet plans are cheaper than the Brighthouse plan I was still on. For $2 less a month I now get 400 Mbps down. I just wanted to share in case anyone else hasn’t checked in with Spectrum after the switchover.

P.S. I’ve been trying DirecTV Now on the Apple TV. It is okay but the Apple remote is lacking, you can’t rewind “live” TV, and the DVR service will erase stuff before we’ve watched it.

Ending 2018 in Blue Ridge, Georgia

We spent the weekend hanging out in the cabin just outside Blue Ridge, Georgia. We explored Downtown Blue Ridge a few times as the area has really grown to accommodate mountain tourists like ourselves. Fun times had by all except for those few scary moments coming up and down the mountain in an underpowered front wheel drive skateboard…I mean sedan.

[wpvideo 2FMHf3Ue ]

My wife is putting the new slate board to use tomorrow evening. Thanks Google Developers Group!