Posts

Showing posts from 2022

IRequestCultureFeature returns null in ASP.NET Core 6

... unless you first register its use in your service configuration: app. UseAuthorization (); app. UseRequestLocalization (); // <-- app . MapControllerRoute ( That's all, folks!

How to uninstall Mudlet

Here's a weird one for you. When I tried to install Microsoft Teams on my laptop, instead of installing the software, it launched Mudlet . Now, I'm a fan of the app, but ... that's weird and unwelcome. Trying to uninstall Mudlet didn't help - Teams simply reinstalled - and started Mudlet again (somehow). Googling provided little help. I tried running CCleaner , but that didn't solve the issue either. After a fair bit of digging, I found the following solution: Both products use the Squirrel installation system (and that's where things break down). Delete the Squirrel package cache ( %LocalAppData%\SquirrelTemp ) Delete the Mudlet folder in %LocalAppData%\Microsoft (what's it doing there to begin with?) You should then be able to install Microsoft Teams and actually use THAT app.

Now everyone can have their own, free, website!

Image
I'm super excited about - allowing anyone to write down their thoughts and have them  published on a variety of websites. NOT SOCIAL MEDIA WEBSITES, but websites the author actually controls/owns. And it's free. And you don't have to be a developer to use it!

How to work from home

Image
Get an animal that wakes you up early in the morning. I have a cat who wakes me up at 4am. Spend time in the morning tending to your animal and yourself, feeding both of you. That is: Cook your breakfast or otherwise prepare a tasty one. If you're not a breakfast person, prepare lunch. Clean up after yourself. If you can, do you food shopping in the morning. Ask yourself: What other things can I get done (or partially done - tinkering / puttering is fine!) in the morning hours? Eat and drink in the kitchen / dining area, or outside your home. The only exception is water, which you may bring into your office. Prepare a dedicated space where you do work. If you cannot dedicate a whole room, dedicate a part of an area. Avoid dedicating parts of the kitchen or parts of your bedroom. Spend energy optimising your spaces. Don't wait for someone else to approve spending on your office space. Spend money wisely to improve your work area. If you can get some of the money back from your e

@Jeffdelaney23 is doing a great job sharing knowledge!

Image
I've been enjoying  Jeff Delaney  videos for a while now and am impressed that he's still going at it after  5 years of publishing on YouTube . Most recently, I watched his gzip file compression in 100 seconds and by now, I'm a dedicated subscriber! I've also (finally?) realized lately that this Swag thing is not a pain in the ass at all, but instead is a great way of supporting them, showing that you're supporting them and opening up for conversations with the yet-non-believers. If you're wearing a fancy Fireship.io t-shirt , someone is likely to ask what that is - well, more likely than if you hadn't worn it at all. What I'm trying to say is - if you truly appreciate a content creator's works (e.g. is a regular subscriber), please support them by buying their stuff !

Practical WebAssembly by @sendilkumarn

Image
I was lucky enough to get my hands on a copy of Practical WebAssembly  by  Sendil Kumar Nellaiyapen  (Engineering Manager at Uber). I found the book very informative, sharing insights on the WebAssembly we use today, but also just-enough technical details behind the scenes to fully appreciate where we've come. Running the examples on Windows, however, I found that the book lacked some clarity. Here's what I figured out. To run the examples in Chapter 1, you'll need to download and install the  LLVM  compiler infrastructure ( from GitHub ), e.g. the  14.0.6 release for Windows . There's no need to build the toolchain from source. Once installed, you'll have access to  clang ,  emcc  and other tools. I found the output on Windows was different than the examples (presumably from a Mac). The  sum.c  example, looked like this after compilation by clang: ; ModuleID = 'sum.c' source_filename = "sum.c" target datalayout = "e-m:w-p270:32:32-p271:32:32-

iOS/OSX "Spoken Content" - ♪ these are a few of my favourite things ♫

Starting a new job comes with a lot of reading! I'm a slow reader, so have been paying attention to tools and techiques to help me along. I've previously mentioned Audible as a wonderful resource for getting that reading in and it has recently helped me access many great books such as the one listed below. When it comes to E-books and PDF documents, I've had great success with iOS' accessibility features that reads content for you, and I have recommended these features to former colleagues who I know have been struggling with reading as well. Now, my wife just entered the office and found me struggling through a lengthy PDF document on my new MacBook and casually asked why I didn't have the computer read it for me. Lo and behold, OSX offers the same excellent accessibility features as iOS ! My new Mac has proven itself invaluable in a number of ways already: The battery life is amazing - I used it for most of my first day in the office "plugged in" and h

Game development with Unity for .NET developers - a book review (part 1 / N) @chen_jd

Hello World! I'm slowly making my way through the ultimate guide to creating games with Unity and Microsoft Game Stack  by Jiadong Chen  [ blog ] and I'm having a great time!

Transitioning to plain text

Transitioning to plain text (this blog post was authored in Visual Studio Code, using plain text (well, markdown)) I'm an avid note taker, having used my fair share of both Evernote and OneNote. After listening to the Managing Humans audiobook (Michael Lopp), however, I've given a try to taking plain text notes, reducing formatting to a minimum. What I've found, is that plain text offers great ease - there's a lot less to think about / consider! Together with frequent commits to a (local) git repo, I've have a wonderful experience, which I want to share with you. How to Dedicate a directory for your notes (e.g.  C:\src\tech-lead ) Initialize a git repository (e.g.  cd C:\src && mkdir tech-lead && cd tech-lead && git init && echo "# Exclude" > .gitignore && git add .gitignore && git commit -m "My notes" ) Pat yourself on your back - you're done! Ongoing considerations Refrain from saving every

Find images in a subfolder

Image
I had an imagined need to show all pictures in a git repo for a li'l thing I'm doing. As I had to google to make this work, I figure I'd share how it's done FWIW: Navigate to the common root directory ( C:\src\DevTeamRota\DevTeamRota\ wwwroot  in my case) Search for images ( kind:image ) Pretty obvious in  retrospect , but hey.

Writing a (local) World of Warcraft Addon

Continuing down the wow addon / lua path , I figured now was a good time to write my first addon. I don't intend to publish this anywhere (except, well, here, kind-of); this is just for fun / a learning challenge.

Macro-first WoW

Image
Coding for fun / as part of a game, is a great way of learning (aspects of) programming.

Maximizing a (Chrome) Window with PowerShell

(Actually, don't do any of this, just use WIN-SHIFT-Arrow key to shove the window to an edge, where you can interact with it again). Scenario and background One of my windows opened off screen and I my go-to ALT-SPACE-X did not solve my issue. I also googled and found a number of Stack Overflow answers, but they didn't quite do what I want. I know enough PowerShell to cause damage, I have years of C# experience and I've dabbled with the Windows API (for play projects) more than once. Solution 1. Add POWER through .NET and the Windows API Add-Type "using System; using System.Runtime.InteropServices; public class Window { [DllImport(""user32.dll"")] public extern static bool MoveWindow(IntPtr handle, int x, int y, int width, int height, bool redraw); }" 2. Use PowerShell to find all processes, passing each process' main window handle to our Windows API Get-Process chrome | ForEach-Object { [Window]::MoveWindow($_.MainWindowHandle, 100, 100, 1

WASM development via the Grain Programming Language

Image
Spending my Saturday morning reading about GPL, a language aiming to feel "largely familiar and homey, with many quality-of-life improvements that you’d come to expect of any new-age language 📃 https://t.co/JAmiErT3Yn 📺 https://t.co/bKfPQjj7p6 🏷 #webassembly #wasm — Sami Lamti (@SamiLamti) May 28, 2022 Installing Grain from Source ⚠ Fair warning: This takes a long time (60+ minutes on my gaming laptop, granted I was doing 5 other things at the same time as I normally do). With node and npm already installed, I started following the instructions on XXX. They didn't quite work for me on my Windows machine, however, why I instead ending up doing the below: Enable Developer Settings Run a bunch of commands git clone https://github.com/grain-lang/grain cd grain npm ci cd compiler npm install cd ../cli npm install npm run build-pkg npm run link [Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + (npm bin --global) -join "`n","Us

Random thoughts / lessons learned from a tech lead / people manager

Image
Retrospectives are all they are hyped up to be. Reflect back on the team's performance / accomplishments regularly (monthly; set a calendar event/reminder), as it's all too easy to just continually focus on the next thing and never remembering to cherish all the good that has been done. Retrospect with each team member on a regular cadence (e.g. quarterly; again, use your calendar), revisiting goals set in the past. This will help both of you to realize what has been done - and that needs to be celebrated! - and what has slipped between the cracks. Collect accomplishments on each team members and the team as a whole. I have a separate file for each of my engineers, summarizing their next/immediate goals and their individual achievements. As I notice them doing something good, I jot down the date, their action and some context and then bring that up both in our weekly check-in and also in our regular 1-1.  When you've delegated something (e.g. facilitation of a meeting), rea

Building a provisioning script

This article describes how you'd create your own PowerShell-based provisioning script. In the given example, we'll provision a pre-configured virtual machine which can be used for e.g. coding interviews. The script utilizes an ARM template that has been exported from Azure's Create a virtual machine  wizard , where reasonable default values have been set up, e.g. which machine size and which OS to use. Once you've gone through the wizard, it lets you Download a template for automation . Extract those files into the folder where you intend to author your script. Speaking of ... First we ensure that we have the az client tools installed, as we are dependent on them: if ( $null -eq ( Get-Command az -ErrorAction Ignore)) {     $installer = .\Download-File.ps1 `         -DownloadUri 'https://aka.ms/installazurecliwindows' `         -OutputFileName 'az-cli.msi'     Start-Process "msiexec.exe" '/i' , $installer     Write-Host "-  

Moving commits from main to feature-branch

For when I forget to change into a feature-branch before committing a bunch of changes next time, here's how I fixed it this time: git checkout -b further-refinement Create the feature branch I should've created before I started to mess around with code! git checkout - Return to the main branch. git log -10 --oneline Show the 10 latest commits from the main branch, each on a single line. 👀 find the last commit you'd like to keep on main (moving the rest to your feature branch) git reset --hard <commit-id> Remove the commits you'd like to move from the main branch (they'll still be in your feature branch). git checkout - Return to your feature branch. git push --set-upstream origin further-refinement Push it (to GitHub). gh pr create --fill Create a PR via the GitHub command line tools (or look at the /pulls list in GitHub and create from there)

Getting started with Rust on Windows @rustlang

Image
1. Download and install Build tools for Visual Studio 2019 2. Select Desktop development with C++ 3. Select the topmost two optional components 4.  Download and install Rust Now, one of the cool things with Rust, is that it installs with learning resources. Once you've installed Rust, call  rustup doc  to navigate to the included book The Rust Programming Language ( also available from nostarch press ) Go forth, my fledgling rustacian! Build something amazing!

Reminder: You can debug PowerShell (even modules!)

Image
Scenario I made a small change in a COMMENT in a PowerShell module. Result Our build server puked on me. I rebuilt a couple of times, 'cause "I didn't do anything!" Slight frustration. Fix OK, find the offending code (CTRL+G in VSCode to go to the exact line). Some "Export-NUnitXml" function exported from a PowerShell Module. - Declare all variables up to the point of the failure - Add a breakpoint : Set-PSBreakpoint -script ".\.build\tasks\Export-NUnitXml.psm1" -Line 21 - Run the function in VSCode's terminal - Breakpoint hit. - Find offensive code that just decided to show up today - Fix it. Debugging makes things easier. But wait, there's more 😅 If you're making changes to PowerShell Modules, remember that you have to reload them before you see your changes in your session. Or in other words: Edit Code > Save > Import-Module -Force

A review of "Customizing ASP.NET Core 6.0, Second edition" by Jürgen Gutsch (@sharpcms) @PacktPub

Image
I finished reading Jürgen's new book this week-end. Here are my   key takeaways ,   the good ,   the bad and the ugly . Although the book is titled  Customizing ASP.NET Core  6.0 , it also addresses content from ASP.NET Core 3, 3.1 and 5.0. My key takeaways from the book One of the biggest benefit I get from reading books and blog posts are eye-openers or a raised awareness of "what's out there". Jürgen gave me some 'aha's throughout his book: Cmder Cmder is a really nice  console emulator software package , delivered as a portable distribution ready for you to bring with you, if you so desire! A chain of commands This little terminal nugget: dotnet new <project type> -n <name> && cd <name> && code -r . e.g. dotnet new mvc -n MvcSample && cd MvcSample && code -r . ...translates into creating a new Model-View-Controller project named  MvcSample  in a new  MvcSample  directory (you can override this with the  -o