Blog Posts
Mini project goal To replace my current gateway (Ubiquiti, but not Unifi) and Unifi controller with a UDM SE for a more integrated Unifi experience, being able to easily segregate my vlans, wlans, setup firewall rules, etc from a single interface. While keeping the settings and adopted devices that I...
Actual real life problem I’m using System Assigned Managed Identities for some of my App Services in order to not handle credentials manually in code, and also to make sure that the life cycle of the Service Principal (a managed identity is a Service Principal) matches that of the App...
So you’re interested in taking either/or both the AZ-900 and the AZ-204 exams in order to become Microsoft certified as a Azure Fundamentals or Azure Developer Associate. That’s great! Perhaps you’re starting your journey towards a cloud oriented role, want to make sure that you don’t have gaps in your...
Actual real life problem We’ve got a .NET core project with a web API, and we’re using Swashbuckle to generate Swagger Open API documentation for it. Now we want to integrate this into our API Management instance, using a custom DevOps task (not important for this post) which requires us...
There’s a big difference between logging for debugging/development purposes and for monitoring your application. When developing it’s quite easy to write a line containing something similar to this log.LogInformation($"The code reached this function with id {id}"). And this is valuable when debugging the code, but when you’ve deployed it and...
Preamble This came about when I asked myself the question “What would be the easiest/quickest way for me to get a company webpage up in order to satisfy Apple’s requirement for registering as a developer”. I already have this blog hosted on Github pages (Source code), and although this setup...
You’ve got an API, it’s secured by OAuth using the Client Credentials flow (typically used for server to server communication), and now you want to enable the consumers of your API to try it out in an authenticated way, directly from Swagger. This post is about an API that uses...
What are we trying to do? We’re trying to lock down our Swagger endpoints (index.html, swagger.json) in order to disallow unauthenticated users from reading our documentation. Why would I want to do this? Perhaps you’re building a internal API, or an API that should only be available to a few...
The Durable Functions documentation describes one way of doing this, this does however not fit every use case where you might need to run a orchestrator function as a singleton. Actual real life problem I’ve got an orchestrator that triggers every 5 minutes, however, at times the execution of this...
This post started out as me trying to solve a fairly straight forward problem (stated below), but instead fell into the rabbit hole of YAML structure and concepts. Problem I’ve got a docker-compose setup for running an app locally, it consists of one database service, and one api service. It...
Problem This is a continuation on This blogpost. But now we’ve come to the step we’re I want to add a default database when the container starts for my application to connect to. When doing this with .NET Core there’s an option for creating a database if it doesn’t exist,...
Problem I’m currently in a team that’s developing an app with a python backend, that’s deployed to Azure with a MS SQL Server as a database, but uses a SQLite database for local development. This creates issues with having different capabilities and slightly different syntax/rules/keywords. One good thing is that...
Problem I have a function that should trigger a callback, lambda, Func, Action (or any other name that your language of choice might use for this concept). I also want to write a test to make sure that my function trigger this callback under certain conditions. The least invasive way...
Actual real life problem I’ve got a .NET (framework) MVC application (using EpiServer) where most (but not all) views are typed to a Model of type PageViewModel<T> where T: PageData. The feature to be implemented is to render a property of PageData whenever we’re rendering a view that’s typed to...
There’s at least 2 ways of interpreting the title of this post, it could mean: As an API, accept tokens coming from multiple applications that use different identity providers. As an application, allow a user to sign in using multiple 3rd party identity providers, and optionally act as an identity...
Currently I have a decently small project that consists of a React SPA that’s built using webpack, the SPA communicates with a api that’s built on .NET Core (2). The code for these 2 units lives in the same repo on Github and they are built on, and deployed to...
Having worked with React for the last 3 years has made Components my favourite way of structuring code, it might have been 5-7 years since I worked with WPF and Silverlight but I do remember them having UserControls as a concept which is fairly similar to Components. This term doesn’t...
So you’re using IdentityServer4 in your .NET Core application that you’d also like to deploy to Azure. You’ve been using .AddDeveloperSigningCredential() to create keys for signing your tokens and you’ve figured out that this is no good in a production environment. Maybe you’ve been thinking about generating a certificate yourself...
I was recently asked to hold a React Native hackalong with the not so secret agenda of finding out if React Native was a good alternative for quickly prototyping native applications, if it was viable for production applications, and how fast a web/React developer could get up to speed with...
How to modify the deployment process of microsoft azure is one of those things that I keep forgetting how to do, or find myself making more complicated than it has to be. This post assumes that you’re deploying with continuous deployment from github, but it should be the same for...
###Background Asp.net vnext now supports creating authorization policies through code. What this means is that you no longer have to copy paste your role/claim names all over your application (Or build your own system around this). You can instead declare policies in a central place and authorize based on these,...
Or “Where did RegisterGlobalFilters go”. You might have read Securing your ASP.NET MVC 4 App and the new AllowAnonymous Attribute or similar posts about adding a global [Authorize] attribute to your MVC project and then whitelist specific routes such as login pages. The code for this would look like this:...
Committing appplication settings such as OAuth secrets and other credentials to your version control system of choice is a bad thing, especially if you’re working on a open source project where everyone can see your code. One might think that we could solve this by using the Web.Deb.config, or any...
I’m currently converting a webapplication into a multi-tenant solution for a client at work. Handling translations in the app is currently done using resource (.resx) files to build a master resource collection. The client can then translate any resource into a specific language using a separate tool that creates satellite...
I love javascript, I really do. One of the things i really enjoy about the language is its dynamic nature where objects are actually hashmaps, associate arrays, dictionaries, or whatever you want to call it. This gives us the ability to get and assign properties using indexing and property names...
The augmentation factory pattern is an extension of the normal factory pattern when working with dynamic languages. It can be thought of as a way to get interfaces into javascript, or a way to deal with inheritance without using any actual inheritance. I do not find it helpful when working...
My goal has always been to be a “full stack developer” and this is also something that is required of me in my current position. But there used to be a time when a spent most of my energy on the top layers of application, ie UX, APIs and business...
I recently came across CSSSlider, a tool for creating pure css sliders/carousels, no javascript required at all. I really didn’t get how they had done it at first, since I’d never thought of the approach that they took. I took a look at the source code and saw a lot...
I wrote Tily, a css framework for creating fluid, perfect ratio windows8/windowsphone style tiles in web applications about a year and a half ago. It’s taken this long for me to write this post explaining how it works, but hey, here it is. Most web developers have probably at some...
I create a lot of different APIs in my work, several of them send out fairly large arrays of objects where the property names of these objects are the bulk of the data being transfered. This is mostly mitigated by compressing the data, but I figured, why not try and...
Inline elements in html are elements that flow in the documents direction (ltr/rtl) until they hit the edge, and then they line break, just as text in a book or a newspaper. When rendering such elements (spans or display: inline,inline-block etc) the browser will treat the whitespace between them as...
99% of the work that I do involve asp.net webapi and asp.net mvc in some way, I normally build applications using knockoutJS on the frontend and asp.net webapi as, well, a web api. Json.NET is the default javascript/json handling library in asp.net mvc and webapi. It normally perform its magic...
Exciting times as Stratiteq, I’ve gotten my first “new” application where I will be tech lead. It’s an application built for a specific part of the customers service offerings, but it turns out that it would be perfect for other services that the customer offers. The teams job will be...
I’ll be the first to admit it, my “workflow” is/was really ancient, my professional work is to 99% done in Visual Studio which has made me a bit spoiled since it handles almost anything you want it to do. Work that I do for fun on the other hand is...
I have noticed a pretty common confusion about what the jquery data function and HTML data- attributes are meant to do amongst developers that are new to building frontend bits. This can also be confusing for developers that got into jQuery before 1.4.3 (like me) as the data function was...
Why a new pattern? I should probably begin by saying that I have no idea if there is any prior art for this, this is something that I just came up with while building the back-end for a new application. It is meant to simplify making a sequence of repository...
So you want to pass a list of something to a SQL stored procedure/Query using Dapper? And you want to receive it as a Table Valued Parameter? Sounds great, you might feel a little bummed that this isn’t supported out of the box in Dapper, meaning that you can’t simply...
We sometimes find ourselves in the position that we have a single project that exposes several sites, most commonly a large brand with several smaller brands in the same corporation. This is yet another way in which LESS shines in comparission to writing plain old CSS. What we can do...
So today is my first day of summer vacation and I thought that would be a good date to write a post about my progress with my calisthenics goal. First thought, Calisthenics isn’t like lifting weights. Lifting weights has been pretty much the single form of excercise (besides some regular...
I pretty much always run my .NET applications on a local IIS server instead of using Visual Studios built in server, I also use the local IIS for debugging. The reasons for doing this is part performance, part not racking up VS debug server instances and part wanting to run...
After a year of thoughts and a few projects regarding modern UI in web applications I now feel that I’ve got enough material to assemble a new web framework. There might be a few other ones out there trying to accomplish the same task, but I feel that most of...
New goals in the field of fitness. I want to be able to to planche pushups and the human flag. This of course requires me to change my normal bodybuilding style regiment and include some form of calisthenic movements. I’m currently in the stage where I need to work on...
Use Ror 1.9 for painless installation. http://railsinstaller.org/en
Python 2.7.5 for Pygments.
setx path “%path%;c:\Python27”. Restart console
Don’t forget to set HOME PATH if it’s currently set to a network drive. SET HOME=%USERPROFILE%
gem install jekyll
gem install pygments.rb. Only use 0.5.0 as of writing http://stackoverflow.com/questions/17364028/jekyll-on-windows-pygments-not-working
Say that you have a pretty standard app with the /home/index/id routing. You have a page with the following route /home/index/1 and on this page you want a link back to /home/index so you use @Url.Action("index,"home") to generate the correct link. But you notice that the generated link have the...
Todays funny bug, no ajax request would return data in a real IE8 (not effecting ie10 in ie8 mode). We’re building a MVC4 + WebApi app and are heavy users of ajax that we setup using $.ajaxSetup and setting custom AuthToken and AuthTokenSalt headers in the beforeSend function. Everything works...
Some headache last night just before going to bed. I was trying to output two Uris to data attributes on a html element for navigating to different pages based on the current state of the page. I was getting weird crashes and the debugger kept hitting an action that I...
A small gotcha that happened a colleague tody. A simple search for paginated content went wrong. The first page searched for items BETWEEN 0 and 10 and the second page searched for items BETWEEN 10 and 20, the first page looked alright but the first item on the second page...
Whats the first thing you do when you buy a new car? Upgrade the stereo to support A2DP phones of course The PCM 2.1 system found in my car only supports two ways of playing your own music, using a cd or a fm transmitter. Neither of thos really speaks...
It is for some reason possible to add duplicate mime-types through inheritance to a site running on IIS. Doing this will cause 500 server error for statically served files. My issue was with running virtual directory sites and adding a mime-type to the default site itself. The solution was to...
There seems to be a limitation on visible items in a multilist field when settings the source as a sitecore node such as /sitecore/content/mysite. I didn’t count but it seems to “only” show the first 50 subitems. A solution for this is to instead use a sitecore query as the...
C# Ticks are not the same as Unix Timestamps. Ticks are instead 1/10.000 of a millisecond. This means that we of course cannot just do new DateTime(long ticks); //with the TimeStamp as ticks Instead we have to do it like this. new DateTime(1970,1,1,0,0,0,0).AddSeconds(double ourTimeStamp) Which is actually kind of pretty....
This should have been fairly obvious, but we cannot expect the ViewBag to persist since a RedirectToAction only serves the client with a 302 redirected HTTP response to the new route. A solution for this is to use “TempData[“key”]”, this is a dictionary that is persisted in the users session...
Part of today was to enable an object literal to be used as a prototype. This object in turn had an object literal of its own (along with a few methods). Here is pseudo-code to display what happened: The object to be used as a prototype baseObject = { settings:...
I thought I should share this even though I’m generally against using !important in css rules. Less will place an !important rule after every rule in a mixin if you write !important after the mixin name when you mix it in. This seems logical but it was something that I...
Guides for creating icons that are used when pinning a website to the iphone/ipad homescreen.
Apple documentation
I was experimenting with a new contentpart widget tonight, and when I was done I had a couple of UpdateFromX methods in my migrations.cs file. So I thought to myself, this doesn’t look very good, lets delete everything from the DB and then combine this to a pretty Create method...
New day new requirements. Atleast this was an easy one. The normal action when clicking an anchor tag with an href pointing to an image is to display the image in the browser. Today this was not the desired outcome, instead I wanted to put an “Download image” button next...
If you have ever tried building a new Orchard theme from scratch, and like me you like full control of your markup. Then perhaps you have noticed the extra “zone-name” div that Orchard adds around every zone. This is great for creating a semantic markup, but it didn’t suit my...
Sometimes you have to work with older software, like IIS6 on windows server 2003. And sometimes this happen to coincide with you working on an application that requires an older framework, like Sitecore 6.1 on .NET2.0 I was trying to run a Sitecore 6.1 site in IIS6 on a windows...
It was a real easy task. Display the ImageField and GeneralLinkField for every item that was selected in a MultiListField. So I took a look at the code, crap, it’s XSLT and I’m mostly a .NET guy who never touches the stuff. It wasn’t easy to find a clear answer...