When building a page with a Linear Progress bar, I thought it should have been partially filled and it wasn’t filled at all. Turns out it expected value to be between 0-100 and I was assuming it would have been 0-1. Best to check the documentation over just guessing, but we all know developers hate reading the documentation. So best do some tests to see which range it expects.
Category Archives: JavaScript
Simple HTTP Server
When you have a need to serve up files using http. You can do so with http-server
do this with npx http-server
.
Dokku / NGINX not passing headers
Sometimes you just have to do a workaround when systems aren’t doing what they are supposed to, I have been building this API proxy for Weather Driver. Dokku / NGINX wasn’t passing the proper headers to my server, so I had to do a workaround.
The work around I came up with was to pass all the values in as part of the Request body. I still would like to figure out what the initial problem was caused by. If I come up with a full solution I will post back here about it.
Ignore the outcome of Async Function in JavaScript
If you have an async function in Javascript that you just want to call but don’t care about the result. You can: func_name().then()
. The then part of handling an async function normally takes a function to handle when the async function completes, however you can exclude that function if you don’t care about the result.