Friday, December 21, 2018

Wednesday, October 10, 2018

Trouble running Edge

If you are having trouble  running Edge, specifically: CONSOLE21301: serviceWorker.getRegistrations is rejected due to unsecure context or host restriction in ms-appx-web://microsoft.microsoftedge/assets/errorpages/dnserror.html?ErrorStatus=0x800C0005

Then run this command at a command prompt with admin privileges:
CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

Sunday, October 7, 2018

Thanks to all who attended my presentation at Desert Code Camp 2018 yesterday. Here are the links to the code and slides:

Code: https://github.com/CobaltCoder/CodeCamp2018
Slides: https://www.slideshare.net/CobaltCoder/building-a-website-with-angular

Monday, September 17, 2018

OrdinalIndexOf for JavaScript

A quick port of the Apache Commons StringUtils.OrdinalIndexOf function for JavaScript:

var ordinalIndexOf = function (str, searchStr, ordinal, lastIndex) {
if (str == null || searchStr == null || ordinal <= 0) {
return -1;
}
if (searchStr.length == 0) {
return lastIndex ? str.length : 0;
}
let found = 0;
// set the initial index beyond the end of the string
// this is to allow for the initial index decrement/increment
let index = lastIndex ? str.length : -1;
do {
if (lastIndex) {
index = str.lastIndexOf(searchStr, index - 1); // step backwards thru string
} else {
index = str.indexOf(searchStr, index + 1); // step forwards through string
}
if (index < 0) {
return index;
}
found++;
} while (found < ordinal);
return index;
}


Tuesday, September 4, 2018

Configuring Launch.json when output is in a different folder

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Educator",
"type": "chrome",
"request": "launch",
"port": 9229,
"sourceMaps": true,
"url": "https://local.education2020.com/educator",
"webRoot": "${workspaceRoot}",
"cwd": "${workspaceFolder}",
}
]
}

Wednesday, August 15, 2018

Saturday, May 12, 2018

Error

I love GoComics error message: "Inside every server there is an internal error, just waiting for its time to shine. This one's ours. We vow to cease its infernal shining ASAP."

Thursday, April 12, 2018

Set up TSLint in Visual Studio 2017

How to set up TSLint for Visual Studio 2017

1. Lovingly craft a tslint.json file in your project directory
2. Run this command in your project directory:
    npm install typescript tslint tslint-language-service
3. Add this to the compileroptions section of your tsconfig.json file:
  "plugins": [
    {
      "name": "tslint-language-service"
    }
  ]
4. Enjoy TSLint goodness in Visual Studio

Special thanks to Angelozerr for the service: https://github.com/angelozerr/tslint-language-service

Friday, March 16, 2018

mini-css-extract-plugin

Just so you know, I upgraded to webpack 4 today and it is screaming fast. I was using the extract-text-webpack-plugin which has some issues on webpack 4. Specifically it gave me this error:

Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

I switched over to mini-css-extract-plugin and it works great.

Wednesday, February 21, 2018

Wednesday, January 3, 2018

The same thing we do every night Pinky

My 5 point plan to take over the world:
1. Build unstoppable robot army
2. Give the robots rowboats
3. Call them rowbots
4. Unleash rowbots on unsuspecting, land-dwelling humans
5. Rule Earth from comfort of my recliner