Skip to main content

Posts

Google Service Migration

I recently published an entry where I had gotten back in to understanding how awesome the Google Script was.  I was doing a routine check to see if the script was running in good health and as it turns out, I discovered that the methods used in the ContactsApp were being deprecated - advising to switch to the People API . So, this is just a short journal entry to say I have now updated the repository using this service.  Works much the same, just links the contact to the group slightly differently.  Comments and suggestions always welcome!

Getting all deltas from Auth0

Before I get in to the solution of this article, let me tell you how it started and fill you in on the problem that arose.  I wrote a procedure to get daily deltas of users - those of which who had created/updated their account on the given day (and including the day before for good measure on the GMT timestamp).  The simple search criteria was just the following: updated_at:[yyyy-mm-dd TO yyyy-mm-dd] Simple, right?  the []'s being the dates are inclusive, while using {} would mean exclusively.  Auth0 lets you mix these on either side depending on your use.  While this is all well and good, Auth0 will limit the number of results (even with paging) to 1000 only. So, your first option is that you could have your procedure create a user export job, and then parsing through the results and eliminating those which do not meet your updated_at search criteria.  I can tell you first hand that eventually the amount of users will just get to be too much and cumb...

The power of Google Script

I'm pretty excited to share today's post, because I have found inspiration on something I've wanted to do for quite a while.  I'm one of those users whose life is completely on Google.  A few years ago I had emptied my filing cabinet, scanned everything in and put them to easy to navigate folders in the Google Drive.  This is just amazing because I continue to photograph and scan everything including receipts - and if I need to return a product, I scan the barcode and the drive's image recognition can find it within either PDF's or images -- bang! And then there is Google Photos, where I have tagged almost everyone I have ever known, and have migrated all of my albums to one easy to search location.  Finally after a few hours procrastinating, I even put a label next to each and every one of my contacts, and now never miss a beat. But then there are my emails; while everything was up to date and marked as read, my labeling history here is less than to be desired...

New Year, New Techniques

Been a long time since my last post!  After Christmas, at work we have been reinventing our current eCommerce solution with a whole new fresh approach and designing a whole layer of Micro-services out of Kubernetes and gRPC .  I'm still getting my head around the configuration of Kube and deployment strategy - fortunately I have a fantastic supporting team helping me through that, but I've been jumping right in the deep end of gRPC. It allows you to specify much like an interface, defining what functions can be called from a package and what properties the request and response consists of, so any language can consume this configuration and call it appropriately.  It also reduces latency by removing the typical handshakes of the HTTP protocol.  But that doesn't mean that you cannot write typical REST endpoints to it.  To the contrary, be sure to take a look at the NPM package gRPC GraphQL Server .  It seems quite new but does a fantastic job. To compliment ...

Auth0: Authorization Flows

 Today I write this entry after a few late nights of personal research.  I am building an app and an important part of it will be to integrate it to other services using Zapier .  To do that, I need to make a REST-ful API layer with no login form, but instead to have an authorize routine which can take the user's credentials and to pass back an Access Token . Up until now, other services I have helped establish have either used the Universal Login method, or simply with my own custom Javascript wrapper using the SDK .  Neither of these solutions is going to fit my need.  I did understand that from all of the available methods it had to offer, OAuth was going to fit it in some way, but I did not quite understand how I would evade having to use a login UI element. I've now had more of a solid read over the Auth0 Authentication API documentation, and on the subject of Get Token , there are number of different types of login flows, the main key/value that determi...

Text Manipulation

Today I want to share with you a few powerful examples of what you can do with ES6 - and a little out of the box thinking, and how much it will allow you to quickly scale up in a clean fashion. Cleaning Strings This for me was one of those "a Ha!" moments where the answer was just staring you in the face.  I had to include it since you may typically you might think to use some elaborate library.  Take the scenario where you present the user with an input box that allows for rich text, but you want the cleanest way to only store non-unicode characters.  Try this simple one-line gem: myCleanString = "test-_aaa'#@".replace(/[^0-9a-zA-Z-_' ]/gi, ''); The regular expression in this statement effectively says that for any characters not in this group (0-9, a-z, A-Z and symbol's hyphen, underscore, single quote and space), replace them with an empty string.  Do this for the characters of your choosing. DB Inserts/Updates Here I like to use the power of...

Low Level Debugging

Here's a small tip which I found extremely useful when I came across this type of (loosely) documented crash.  The problem is, it is extremely difficult to know at what point it crashed as there is no stack trace as part of it.  Likely as well (as in my case), it was in a vendor component (composer, etc.) which was designed for a different version of PHP. Well, here's the answer.  This guide shows how to create a simple script to include in to your program, which will echo out a filename and line for each " tick " that PHP is processing.  The last one it gets to before it crashes -- bingo, you know what's causing the problem! Hope this helps!