Browsed by
Author: Kenneth Holter

Plotly without Dash

Plotly without Dash

While Plotly’s Dash looks like a great project for getting data visualization dashboards up and running quickly, it may not always be the best option, especially for dashboards that over time evolve into complex apps. So I’ve been looking into harnessing the power of Plotly’s excellent graphing tools, while running technologies that can grow with the app. This post will be somewhat of a note-to-self, to keep track of the viable options for utilizing Plotly on standard technology stacks. Flask…

Read More Read More

React breadcrumbs

React breadcrumbs

I recently needed a simple breadcrumbs implementation in a React app, and thought I’d use https://github.com/NiklasMencke/nextjs-breadcrumbs‘s source code as a starting point for my own implementation. I thought I’d share the source code here in case anyone might benefit from it,. But first, at little context. In the app’s URL, we might see something like this: http://<url>/stores/3/products/58. Note that the numbers are database ID’s for the stores and products. For my breadcrumbs, I wanted the names instead if database ID’s,…

Read More Read More

Sharepoint: List ‘Site Pages’ does not exist at site

Sharepoint: List ‘Site Pages’ does not exist at site

I recently got this error from Sharepoint Online, when trying to fetch a site’s list using https://pnp.github.io/pnpjs/: The code resulting in the error was this: After spending (too much) time troubleshooting this, it turned out to be a language settings mismatch: The site I was connect to was set up with Norwegian as the default language, which means that the list isn’t called “Site Pages” but rather “Områdesider”. So apparently, when fetching lists from sites you must account for site’s…

Read More Read More

Sharepoint Online: Custom web part that display news only from followed sites

Sharepoint Online: Custom web part that display news only from followed sites

At work we rolling out our new Intranet based on Sharepoint Online. While the news web part shipped with the platform works pretty well, we found that we had some requirements that combined didn’t make is a good fit: All news should be available to logged in user News are aggregated from intranet related sites the users follow Users can not opt out from receiving news from their own department With these requirements in mind, we decided to implement our…

Read More Read More

Next.js: Cannot read property of undefined

Next.js: Cannot read property of undefined

I had a bug in my Next.js app, in which the props passed to my component unexpectedly was undefined. Duckduckgo’ing the issue didn’t result in any resolution, as my particular mistake was a self introduced bug. Just in case others makes the same mistake as I did, here’s a quick write-up. Consider this /pages/blog.tsx file: When executing the above code, I got this type of error message: “TypeError: Cannot read property ‘posts’ of undefined“. Many Next.js developers may have spotted…

Read More Read More

SharePoint Online hub sites namespace and structure

SharePoint Online hub sites namespace and structure

For my company’s upcoming intranet based on SharePoint Online (SPO), we’ve looked into ways to organize our sites. As I haven’t found much online information on the subject, I though I’d share a couple of points here. Namespacing First, let’s discuss namespacing. We’ve had SPO around for a long time, long before we got around to manage it properly, so we have numerous sites with vastly different URLs and contents. As our intranet will consist of just a subset of…

Read More Read More

Storing valid, sanitised HTML in database to mitigate malicious code injection

Storing valid, sanitised HTML in database to mitigate malicious code injection

In a typical cross-site scripting (XSS) attack, the hacker submit a HTML form which include malicious code. When another user visit the page in which this data is rendered, the malicious code is executed. There are at least a couple of ways to mitigate this risk: When the hacker submit the HTML form, any malicious code is removed before storing the data in the database When retrieving data from the database, removing any malicious code before rendering it on the…

Read More Read More

Custom CSS on SharePoint Online sites

Custom CSS on SharePoint Online sites

We’ll be using SharePoint Online as platform for our upcoming intranet. As Microsoft currently doesn’t support much visual tweaking, we were looking to apply our own CSS to the intranet related SPO sites. Applying Custom CSS is not supported, so we were looking for a workaround until Microsoft hopefully does enable this in the future. Although not supported, and likely not even recommended, we got our custom CSS up and running by creating an application customizer, based on the official…

Read More Read More

Updating Jenkins CI behind corporate firewall

Updating Jenkins CI behind corporate firewall

Our Jenkins CI server (https://jenkins.company.com) doesn’t have access to Internet (neither directly nor through a proxy), yet we need to update both Jenkins itself as well as the Jenkins plugins. We’ve set up another of our servers, https://jenkins-repo.company.com, as a Jenkins mirror site, which on a regular basis runs this command in a cron job: The /srv/mirrors/jenkins folder is hosted by Nginx. As the rsync’ed files contain references to https://updates.jenkins.io, Jenkins will try and contact https://updates.jenkins.io when downloading the updated…

Read More Read More