Skip to main content

Posts

Options outside of ML

Today I wanted to share what I have done in a recent experiment to address an issue that has been quite rapidly getting out of control.  We have a responsibility of pushing out a number of catalogues on a week by week basis, and since the source information has got product labels truncated down due to the size of the original input field, we have got the manual task of renaming to their full displayed length. Of course, we have got our ways of reducing the amount of manual updates on this, but we certainly could not pick up on most things as fast as a machine could.  It is not as simple as just a "find and replace" though, because while such abbrieviations as "sce" mostly means "sauce, it's never a one-size-fits all, and depending on the brand, they can also each have their own spelling. I then came up with an idea; using some form of diff algorithm, and having a dictionary be learned associated with the products respective brand name.  The library I f...

Things I've Learned

Greetings, fellow devs! It's set to be a busy month, both professionally and with some well desired home projects as well.  I don't have anything too specific, but I wanted to touch on a couple of things I've learned lately and what I want to learn in the future in order to proceed. Python versus Golang I recently conducted an online poll , where I am looking to make a Google Cloud Function as a serverless API, which will be heavy in file processing.  I don't know either language half as good as I know PHP, so I am excited to experiment in new avenues.  As you can see, Golang was the clear winner. I like to learn by example, so I've found two main resources which I think will be what steers me in the right direction: Go By Example - in particular the section of reading/writing files, and Multithreading in Go Tutorial   Never accept standard error reporting   On one of the most important projects I am actively working on in my 9-5, for too long I ...

New Year, New Projects

Happy New Year, to you all! The start of 2019 may have me starting to blog potentially about my journey of having an experiment apply for intellectual protection! I first started this idea quite a long time ago, and a little ashamed to admit I first started to do it in VB6. Needless to say, I failed miserably.  However I hadn't lost sight of the poison to revisit it in another language, and it actually send like it now has promise! I'm sure it goes without saying, that I won't be disclosing the idea on this public forum as of this moment.  But, watch this space. I have another project I want to work on right now as well, and so far have developed the main API's necessary. My speciality is back-end development and I've only got myself working on this project, like so many projects before which have started and flopped. I've done some of the front-end, but I really think this year, I will need to team up with someone. It's hard though, isn't it. I ...

User Management with Auth0: A Deeper Look

It occurred to me that I never actually got into the nitty-gritty of my last post with some JavaScript code examples, and how easy it can be without being restricted to using templates that you need to force to make work. Take these first scripts: First, after including the API required, the first part is simply declaring your Domain and Client ID which you can find from the application's dashboard. The next two functions, _connectSocial and _login .  Are very similar.  The first takes a string of the social you would like to link (providing you have enabled it in your application within Auth0), and produces a popup modal for the user to enter their credentials. The second function allows you to simply pass a username and password which you can use values from a form you create.  You'll notice for both functions, it has a parameter it is passing called redirectUri .  Here I am specifying for it to come back to the same page after the authentication has proce...

User Management with Auth0

Tonight I wanted to write about my current journey with moving our user identity management provider (which shall rename nameless), over to Auth0.  I would like to talk about the pitfalls and triumphs as we go.  It's mostly all good - a shame we hadn't done so sooner! Now one of the most attractive attributes is the different methods/connectors that are provided in order to easily integrate your existing system, and I mean they cover just about everything , but this is also a segway to my first - very little - bit of criticism.  From what I see there are two main channels to provide some type of form to present to your user to input their credentials.  By the way, I'm still learning so please feel free to say I'm wrong at any stage. Lock / Universal Login   Hosted Pages There is a mention of a " custom " way to work with Lock, but the customization looks little to be desired.  As to the hosted pages , well, again - correct me if I'm wrong - but it l...

WooCommerce: Controlling an Asset CDN

Continuing on from my last post , I faced a new issue when it came to adding products and the associated images I was putting in (from Cloudinary ) was getting uploaded to the WordPress media library. Not only that, using the URL from my site instead of the CDN it had come from. Double up on all of my images, what a waste - and I want to host from the CDN to keep costs of bandwidth down.  So let me show you how I overcame it. Separating the herd What was interesting, is that it was keeping a record of the original source location, and I found I could filter these apart from the rest of my media library: With this in mind, I wrote a function around it so I could use it to give me a true/false if the given attachment was from this source. Attaching the hook Next, needed a way that as soon as an image was added, that it would update the attachment (post) pointing to the correct reference, and not to the file on our server. I found the add_attachment hook, which fires only...

WooCommerce: Utilizing Custom Attributes

I must admit, I have a quite a love/hate relationship when it comes to WordPress.  As with some frameworks, it often takes a bit of rewiring to be not so... controlling.  On the other end of the spectrum, it has an enormous community, and you'll almost never be out of work when it comes to being able to build and support.  Plus, to be fair, it is not as targetted directly to developers unlike other Content Management systems like October CMS . Back on topic, I have recently been given a requirement to integrate our internally developed product CRM with WooCommerce, and would like to cover one important aspect of it: custom attributes.  It has taken a lot of research to making it just the way we needed to, so allow me to share some of the things I have learned along the way. First, we need to add our products with our custom attributes, this topic, while it was available, didn't seem to be as documented as attributes with set options (terms) attached to it, so it ...