Blog

Testing ElectronJS With Mocha & Spectron

In this post I will be outlining how to test your ElectronJS Apps with spectron and mocha. First to get started we need to install spectron. !!!!IMPORTANT!!!!! this threw me for a while with compatibility issues go to the GitHub page and make sure you are using a spectron version...

JS Get Media Mimetype From Url

Little function to grab the mime type from a video url, using it in one of my apps will continue to add to it. function getMimeType(url) { var ext = url.split(/[#?]/)[0].split('.').pop().trim(); switch (ext) { case 'mp4': return 'video/mp4' break; case 'mov': return 'video/quicktime' break; case 'flv': return 'video/x-flv' break; case...

Switching To Githubs New Personal Access Token Authentication

Git has recently announced that at the beginning August 13, 2021, they will no longer accept account passwords when authenticating Git operations on GitHub.com. Panic sets in!!!!!! Don't panic its pretty easy. You can read up about the updates here. https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ I needed to setup a new repo and had...

VideoJS Dash & HLS Bitrate Representation Switching

Building many plugins for VideoJS I have a bitrate switching plugin that has been used extensively. The plugin mainly focused on HLS representations and I was accessing the representations with the following code. var player = videojs('my_video_1'); player.one('loadedmetadata', function(_event) { var reps = player.vhs.representations(); console.log(reps); }); I then looped through...

How To Debug Your Cronjobs

Recently I needed to debug a cronjob I have setup. It is not as easy as just running the job sometimes you need to know exactly where the error is coming from. I find this the easiest way by far to find out what going on. Create a cronjob time...