RSSAmplifier

Blog

Martijn Storck, Freelance .NET and Azure Developer on storck.io

Recent content in Martijn Storck, Freelance .NET and Azure Developer on storck.io

storck.ioRSS feed ↗28 posts

Latest posts

Calling C# from Ruby with NativeAOT and FFI

Some Ruby operations are painfully slow but writing a C extension to fix them is a big commitment. I wanted to explore an alternative: compile C# to a native shared library with NativeAOT and call it from Ruby using FFI. I picked C# because I know it and love its standard library. To see if it holds up I built a benchmark, reimplementing ActiveSupport’s String#parameterize in ~20 lines of C#…

Adding Azure SignalR Service to Pointing Party

One of the biggest drawbacks of SignalR is that it’s hard to scale. Microsoft provides a solution called Azure SignalR Service that promises to handle it wihout hassle. And guess what? It does! Your application doesn’t have to run on Azure and configuration is easy. It’s good.. pretty, pretty good!

Downloading Sharepoint documents from .NET with PnP.Core, without Windows

Accessing Sharepoint from a .NET application without using Windows is easy. This article will download files from Sharepoint using the PnP.Core package on macOS with .NET 7.

Testing list contents with xUnit and Assert.Collection

xUnit has become the favorite unit testing tool for many .NET developers. The assertion library documentation however is quite sparse. Let’s explore the testing of list collections using a lesser known xUnit assertion, Assert.Collection .

Writing and testing Azure Functions with TypeScript

Azure Functions is a serverless compute solution that integrates with a wide selection of cloud services to allow developers to build isolated blocks of event-driven code in a cloud-native fashion. This post demonstrates how an Azure Function written in TypeScript can interact with a database without any actual database logic in the function itself, and how to write unit tests for these functions.

Serializing .NET 6s new DateOnly to JSON

The DateOnly type that was introduced in .NET 6 is convenient for exchanging strongly typed date information in APIs. Unfortunately, the ever popular JSON format has no standard for date fields. This leads to UnsupportedTypeConverter errors when trying to serialize these fields using System.Text.Json. This article explains how to create a custom JsonConverter to define the serialization format for…

Validating HTTP(S) URLs in Ruby on Rails

Regular expressions are not a great way to validate URLs. Using Ruby’s built-in URI parser, a custom Active Record Validation Helper can be built to safely validate URLs in Ruby on Rails applications while allowing for flexible domain name allow-listing.

Adding a .NET 6 minimal Web API to a Blazor Server project

The new minimal APIs in .NET 6 make creating low-ceremony microservices and backends very appealing, and they’re also a great way to add simple endpoints to Blazor Server applications, complete with Dependency Injection and JSON serialization.

Draw a line chart with Blazor and SVG

Blazor is so great that I’d rather not use anything else. That made me wonder: can I build SVG files using Razor syntax and is that a good idea? The answers are absolutely and definitely!

The broken windows of software

In sociology, the broken windows theory states that if a window in a building is broken and is left unrepaired, all the rest of the windows will soon be broken. This equally applies to software developement is it’s importatnt to be aware of this and make fixing these broken windows a team priority!

Trix editor as a Blazor Component

Trix is a rich text editor that is popular with Ruby on Rails developers. In this post we’re going to take Trix out of Rails and use it inside an ASP.NET Blazor application by making a drop in replacement for Blazor’s InputText component.

Deploying AWS CloudFormation templates from CircleCI

CircleCI provides several official orbs for interacting with Amazon Web Services, but not for CloudFormation specifically. However, that doesn’t mean you need to reach for a community orb to update your stacks from a CI pipeline. A single AWS CLI command is all that is needed to push template updates to your AWS account.

Announcing Xsv 1.0.0

Today marks the release of Xsv 1.0.0, a high performance, pure-Ruby gem to parse .xlsx (Excel) files

Forcing C# indentation in Visual Studio Code using Omnisharp

I always thought indentation was a solved problem, until I needed to adapt to something different. Here’s a trick to force correct indentation for your .NET projects by using the Omnisharp language server.

Pair a TRÅDFRI remote to deCONZ - the hard way

Years ago I replaced my IKEA TRÅDFRI gateway with a Rasbperry Pi with a Raspbee, running deCONZ. It allowed me to mix and match ZigBee devices from various brands and make flexible configurations. Plus the integration with Home Assistant is superb. However, one thing I lost is the ability for the IKEA remote to control my lights directly when the deCONZ gateway is down, which was possible back…

It's time to consider C# and .NET 5

People have been sleeping on .NET and they’re mising out. With the release of .NET 5 this month, it’s time to consider C# .NET for your next project! It’s a great general-purpose software framework that’s likeable, in high demand, easy to sell to customers, has decent performance, is completely open source, mature and has a large backing. What more could you want? Let me…

The case for proportional programming fonts

Programming fonts are stuck in the past. Proportional typesetting is everywhere and there is no reason why you can’t use it for code.

Adding TypeScript to your Svelte components in Rails 6

Combine Svelte and Typescript with Ruby on Rails’ Webpacker to improve your JavaScript workflow and get better feedback in your editor.

Moving from Capybara to Cypress

Cypress makes writing integration tests (or system tests) easier and more fun. This posts shows you the tools needed to add Cypress tests to your Rails application.

Building a small Docker image to deploy your Go application

Docker image size matters. Here’s how you build a small image on top of debian:slim and why that’s a better option than alpine or scratch.

Deploying Ruby on Rails apps to Kubernetes from Gitlab CI

Gitlab CI allows you to create and manage Kubernetes clusters directly from the interface and easily deploy builds to your existing Kubernets infrastructure. Here’s how.

Full resolution Jump Desktop on iPad Pro 11" using SwitchResX

Since the introduction of the Magic Keyboard, interest in using an iPad as a remote terminal for desktops is bigger than ever. The tool of choice for many iPad enthusiasts seems to be Jump Desktop, which supports VNC, RDP and their proprietary Fluid protocol. Let’s try to get the most out of it when connecting to a macOS desktop.

Adding external hosts to a Prometheus Operator helm release

Prometheus Operator is the perfect cloud-native monitoring solution for Kubernetes. By deploying the Helm chart you get a preconfigured Prometheus and Grafana setup plus an array of CRDs to add monitoring your own services. Not everything necessarily lives in a Kubernetes cluster, though. So how would you add external targets to a Prometheus Operator setup? One could define an Endpoint, Service…

Efficient XML parsing in Ruby

TL;DR I wrote a super fast Excel file reader called Xsv , check it out! It’s fast and low on memory because it uses a SAX-based XML parser instead of a DOM-based one. Here’s some benchmarks to prove it. Simple API for XML, or SAX for short is an event-based API, of which development started in December 1997 1 . It is an alternative to the well-known Document Object Model, which was…

Add jemalloc to your Ruby Docker images, now!

The topic of this post is neither new nor original, so I’m going to keep things short. People have been using jemalloc with MRI Ruby for years and praising it’s benefits all the while. The TL;DR here is: for Rails apps, using jemalloc will reduce memory consumption and might increase performance a little. Why? To illustrate my own experience, here’s a Grafana graph showing the effect of switching…

Disable JavaScript source maps in production Rails applications

Ruby on Rails 6 allows us to leverage the excellent Webpack bundler to manage JavaScript and CSS components in a way that’s more native to those technologies than the old asset pipeline: no more gems to wrap JavaScript libraries and no more libv8 gem issues. Another advantage Webpack brings is the excellent source maps. I was surprised to see the source code of my Svelte components, complete…

PICO-8 is the coolest thing I've seen all year

For a long time I’ve been thinking about getting out of my comfort zone and try to develop a game for something like the Sega Mega Drive or maybe the Atari 2600. But for a spoiled high-level developer like me that would be quite a daunting task so I’ve postponed indefinitely. Then last week, in the midst of the COVID-19 crisis, I stumbeld upon this awesome project called PICO-8. To…

Raspberry Pi Can't Find My Wifi

If your Wi-Fi network is on channel 12 or 13, change the regulatory domain of your wireless networking driver to make the Raspberry PI 3B see it.