Browsed by
Tag: software development

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

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

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

REST API entry points to a message based, event driven architecture

REST API entry points to a message based, event driven architecture

A while back I started working at an IT department that didn’t really have much in-house development, and thus didn’t have any integration architecture defined. I set out to look into our business needs along with potential architectures. I’d been a great fan of message based, event driven architecture, and found that to be a good fit for our needs. One of my first projects was quite simple – the user would visit one of our internal websites and submit…

Read More Read More

Using AWS Cognito to authorize access to API Gateway

Using AWS Cognito to authorize access to API Gateway

I’m writing a simple web application that at the moment basically does this: In the web app, users log in The web app contacts AWS Cognito for user authentication. In AWS Cognito, I’ve set up a user pool, think of it as a database, in which my users are stored. When a user sign in, AWS Cognito checks the user pool to verify the password. AWS Cognitor responds with different JWT tokens, including an ID token for the user The…

Read More Read More

Setting up Visual Studio for developing SharePoint online site provisioning software

Setting up Visual Studio for developing SharePoint online site provisioning software

We’re in the process of setting up SharePoint Online as our Intranet platform, and are looking to automate site creation using something like Azure Functions. Currently, I’m developing the business logic for creating the new sites, including setting the correct permissions, theme, links and so forth. I’m using Visual Studio for this project. I’m new to both SharePoint Online as .NET, and as tutorials on setting up Visual Studio with regards to SharePoint Online provisioning seems to be lacking, I…

Read More Read More

openpyxl’s “load_workbook” return empty list of sheets

openpyxl’s “load_workbook” return empty list of sheets

Consider this code: When using one of my xlsx-files as input, my code produced the output Sheet names: [] followed by this expection: After some investigating, I found that the file had been saved as “Strict Open XML Spreadsheet (xlsx)” instead of “Excel Workbook (xslx)”. Both files for some reason have the same file extension, but the former was not supported by the openpyxl library. Saving the file as “Excel Workbok (xslx)” got the code working again.

Adding “–version” parameter to “python3 setup.py”

Adding “–version” parameter to “python3 setup.py”

When building Python packages using setuptools, you typically manually set the upcoming package version in setup.py. For my use case, I found it better to provide the version number on the command line such as this: setuptools isn’t very fond of command line parameters, so I made a quick-n-dirty hack to work around this limitation: