TABLE OF CONTENTS


Today is my experiment for meandering all the way through a single day of work.

The below format is a sample of my current note-taking template which I've been iterating/improving since summer 2015.

play by play

waking up with emails in your cup

Awake and feeling a bit groggy under my heavy 104 inches x 90 inches duvet at about 8am this morning. Scrolling through email and:

Nikolay Kim <notifications@github.com>
7:21 AM (4 hours ago)
to Mention, actix/actix-net, me

it is done

This is insane because "Async-await on stable Rust!" came out November 7th and this rewrite of the core stack of actix only took 1 week! The goal now is to track progress in Update to std::future::Future futures/0.3 · Issue #955 · actix/actix-web. As soon as we get this far I want to take these benchmarks

FrameworkBenchmarks/frameworks/Rust/actix/src at master · TechEmpower/FrameworkBenchmarks

and see what sort of performance we can eek out of tokio 2.0 and std::future::Future!

coffee and infrastructure

At work by 10:30am with Americano 12oz coffee from Brooklyn Roasting Company and Skullcandy Ink'd headphones in to join a conference call from our infrastructure team for a biweekly summary of work. Biggest things coming down the pipe are Docker containers, serverless progress and Spotinst: Continuous Cloud Optimization cost savings for 2019 where we hope to bring our costs down "A TON" for AWS bill. Biggest savings would be for EC2 and RDS with instances severely underutilized.

After the meeting got corralled into a consultation for how to have our "public gateway" connect to a specific S3 bucket so it's not necessarily public on the web. Fun part is that I've been thinking about the best way to do this for about 2 years now.

Good:

Cloudfront tokenized auth

Better:

NGINX jwt token verification proxy pass with IAM role and S3 bucket policy

Best:

Edge lambda authorization before bucket

sprint start (1.5 week duration)

And so now it's 12:15pm and my sprint has officially started and time to get down to brass tax. This week I'm working on getting my Angular/React components playing nice together and iterating on them in a sane way through submodules between teams!

We're currently collaborating internally on a race condition caused by using Angular components/controllers out of context from a big single page webapp we've had for a few years.

Some context to the race condition:

I admit that my first reaction was the same. From a mental model perspective it is easier to think $onInit() is the first thing that happens in the controller; then $onChanges(), $onChanges(), $onChanges() and finally $onDestroy().

But if you think about it, the bindings need to be evaluated and assigned to the controller instance before calling $onInit. And by doing so, a change in the (previously undefined) values is detected, which in turn needs to be reported via $onChanges.

from Controllers hooks order ($onChanges called before $onInit) · Issue #15515 · angular/angular.js

The gist of it is that we initialize this component with an empty array to start with which has a uncaught error whereas the angular-ui/ui-router resolve block in the other app means this state should never happen.

{
  name: 'main.cardstackWrapper.cardstack',
  state: {
    data: {
      eventName: 'cardstack',
    },
    url: '?cardKey',
    component: 'cardstack',
    resolve: {
      stuff: async (injectable) => {
        return injectable.asyncFn() // returns a promise
      },
    },
  },
},

But the concept of using the cardstack component solo means that we don't have this resolution block and we don't gate certain bindings and we need our component to survive without data or undefineds in certain situations.

Google offline OAuth

Discussion later on in the day about having access to updates to Google Docs for written responses in Amplify ecosystem which led to:

Using OAuth 2.0 for Web Server Applications  |  Google Identity Platform

and

api - Do Google refresh tokens expire? - Stack Overflow

Which means that after you give a 3rd party app access to your Google account they can potentially look at all your stuff whenever they want. No wonder all these airline stats companies like App in the Air - Personal travel assistant are so quick on the draw. They literally read every one of your emails.

Definitely good to know for my "Down the Whole" initiative.

React and UI dev

Another discussion going on simultaneous in a guild I am a part of based around all things React.

Christian Battaglia 12:46 PM
I started to dive into react native world and all docs everything default to yarn and downloads are far slower with all the mobile ios/android stuff and it’s been much faster
<anonymous> 12:47 PM
I don't do any RN anymore but that's definitely good to know
Christian Battaglia 12:48 PM
RN 61+ is so insanely easy now
<anonymous>:robin: 1:10 PM
I guess if I were to use RN for a side project I'd go RNW again
Like something small and list views
Christian Battaglia 1:11 PM
why RNW?
Christian Battaglia 1:12 PM
ahhhh ok now I think I finally get react native web (write once for every platform) (edited) 

2 replies
Last reply today at 1:13 PMView thread
<anonymous>:robin: 1:12 PM
Yeeeeeeah
new messages
I'm glad we've sunsetted (is that a word?) the N of RNW for Reading
But for, like, any straight forward list based webapp? I think I'd take on the overhead?
Christian Battaglia 1:13 PM
what was wrong with the native part?

My mind on this glorious Thursday gravitates towards the world of UI development and the new SwiftUI released this year and how insanely pervasive the React ecosystem continues to be.

JSX/TSX to rule them all? On React Native it's only just a bridge and then all heavy stuff is done directly on the JavascriptCore engine which is Safari/WebView's runtime similar to V8. These apis that React Native uses have got to be private to Apple, no? Ideally I want React bindings into GTK+ and QT as well but that's more or less a pipe dream?

I know QT has been started with nodegui/nodegui: A library for building cross-platform native desktop applications with Node.js and CSS 🚀. For React NodeGUI, visit: https://github.com/nodegui/react-nodegui ⚛️.

I'll be curious where this leads me the as I continue to invest heavily in React.

Google offline OAuth architecture exploration

New discussion while I continue to go "down the whole" today talking about offline refresh tokens and Google OAuth2

  1. https://developers.google.com/identity/protocols/OAuth2WebServer#request-parameter-access_type
  2. https://developers.google.com/identity/protocols/googlescopes#docsv1
  3. https://developers.google.com/drive/api/v3/reference/changes/watch
  4. https://developers.google.com/drive/api/v3/push#stopping

Which equates to

  • refresh token store
  • lambda endpoint
  • lambda triggers
  • storage with the metadata about when each doc last changed etc
  • terraform for configuration management

Other links:

  • https://stackoverflow.com/questions/8953983/do-google-refresh-tokens-expire

GitLab diffing web component

Side tracked yet again from a thought I had this morning about the release of std::future::Future in actix-net and wanting to track the story of what exactly the diff of information was. This led me to thinking about my current workflow of tracking diffs which is normally Github but what's the next best thing? GitLab! Which means that I can take certain haml views from GitLab and try and trace through what powers the diffing tool in Ruby/Rails world and maybe recreate.

Relevant code bits:

.tab-content#diff-notes-app
  #js-diff-file-finder
  #notes.notes.tab-pane.voting_notes
    .row
      %section.col-md-12
        %script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
        .issuable-discussion.js-vue-notes-event
          #js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request).to_json,
            noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
            noteable_type: 'MergeRequest',
            target_type: 'merge_request',
            help_page_path: suggest_changes_help_path,
            current_user_data: @current_user_data} }

and

app/assets/javascripts/merge_request_tabs.js

links found today

📚:

🎨:

Share the love!

Thank y'all kindly for the read!