Self-Hosted Bookmark Services
Setting up a Raspberry Pi as a Home Assistant Kiosk
Cloning a Single File from a Git Repository
Task Creation Revision
Dependency Injection in a WPF MVVM Application
Avoiding async void
Windows SDK to OS Version
- Windows 11
- 10.0.26100 24H2
- 10.0.22621 22H2
- 10.0.22000
- Windows 10
- 10.0.20348 2104
- 10.0.19041 2004
- 10.0.18362 1903
- 10.0.17763 1809
Nuget.Config
Set repositoryPath
and globalPackagesFolder
to ensure that all project references point to the new path.
Environment variables need to be cleared as they’ll override Nuget.Config
.
NuGet Packages Location Settings Precedence
NUGET_PACKAGES
User environment variableNUGET_PACKAGES
System environment variable%APPDATA%\NuGet\NuGet.Config
fileconfig/globalPackagesFolder
setting%ProgramFiles(x86)%\NuGet\Config
fileconfig/globalPackagesFolder
setting
MAUI Dependency Injection
High Performance UDP sockets in .NET 6
C# 12: Collection expressions and primary constructors
All About Span: Exploring a New .NET Mainstay
Windows "Show Password" Keyboard Shortcut
Alt + F8
How to set up Windows 11 with a local account
During Windows setup:-
- Shift + F10 to open command prompt.
- Enter
oobe\bypassnro
command. - Setup will restart with “I don’t have internet” option at network selection.
Aranet4 Sensor Database Scripts
Based on Saving Aranet4 data to Raspberry Pi
Create a Windows 11 VM without TPM
When you see the screen indicating that your PC can’t run Windows 11, press Shift + F10 to open the Command Prompt.
Saving Aranet4 data to Raspberry Pi
Simple Guide | Pi-hole on Raspberry Pi with IPv6
Using a Raspberry Pi as a Print Server
Setting up CUPS isn’t necessary with the current Raspberry Pi OS image. Working drivers for ARM are the main problem.
- How to share a USB printer in WiFi with a Raspberry Pi?
- Raspberry Pi Print Server: Setup a Network Printer
- AskUbuntu: Finding device printer's device URI during driver installation
- Raspi StackExchange: Can't get Brother HL-L2300D printer to print from Raspberry Pi
- Raspi Forums: Getting Brother-Printer drivers to work
- How to set up a remote printer which is attached to a Raspberry Pi (or any other ARM computer)
- OpenPrinting: Brother HL-2130
- GutenPrint
- Reddit: Compile x86 .deb printer drivers into arm7 raspberry pi .deb
- SuperUser: Debian ARM and Brother DCP195C with CUPS
- How to Use Your Brother Printer with CUPS on Raspberry Pi
Extending the life of an Intel-based Mac using Windows 11
MS Office Outlook: Default Attachment Save-As Location
Add DefaultPath
string value to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Options
. %UserProfile%
works here.
Mastering DOM manipulation with vanilla JavaScript
via Michael Tsai
Windows Explorer Context Menu 'Open with VS Code'
GitHub Action: Get Commit Message using PowerShell
paint.net IcoCur plugin decompiled source code
Forked from zufuliu/PDN-IcoCurType
paint.net plugins - Windows Store version
Plugins are supported for the Store release. You just have to install them in a different location. Go to your Documents folder, create a folder called “paint.net App Files” (no quotes though), and then create a folder for each plugin type: Effects, FileTypes, and Shapes. And then put your plugins into each folder just like you’re used to with the Classic release. This does mean that plugins are installed per-user, mind you. This method of installation is also supported by the Classic release, by the way.
IcoCur plugin for paint.net
paint.net forum post
Construct your Windows app's icon
Windows 11 scale factor | 100% | 125% | 150% | 200% | 250% | 300% | 400% |
---|---|---|---|---|---|---|---|
Context menu, title bar, system tray | 16px | 20px | 24px | 32px | 40px | 48px | 64px |
Taskbar, search results, Start all apps list | 24px | 30px | 36px | 48px | 60px | 72px | 96px |
Start pins | 32px | 40px | 48px | 64px | 80px | 96px | 256px |
Note
Apps should have, at the bare minimum: 16x16, 24x24, 32x32, 48x48, and 256x256.
This covers the most common icon sizes, and by providing a 256px icon, ensures Windows should only ever scale your icon down, never up.
Advice for Operating a Public-Facing API
via Michael Tsai
StackOverflow: Run git commands from a C# function
With PowerShell
StackOverflow: How to create WPF System Tray Icon when no "Main" host window exists
In .NET 5+ set <UseWPF>true</UseWPF>
and <UseWindowsForms>true</UseWindowsForms>
in the project file.
StackOverflow: How to create md5 of string with powershell without using stream
StackOverflow: How to convert an image to an icon without losing transparency?
Gravatar Image Requests
Gravatar C# API
Git Global User
- User
- Get:
git config --global user.name
- Set:
git config --global user.name {display name}
- Clear:
git config --global user.name ""
- Get:
- Email
- Get:
git config --global user.email
- Set:
git config --global user.email {email address}
- Clear:
git config --global user.email ""
- Get:
Font Icons in .NET MAUI
Using .NET User Secrets
MAUI App Title Bar on Windows 10
Custom Fonts & Material Design Icons in .NET MAUI
Upgrade a Xamarin.Forms app to .NET MAUI with the .NET Upgrade Assistant
try-convert Tool
Tool to migrate .NET Framework projects to .NET “Core”.
How to lock your Raspberry Pi Screen
How to start using .NET Background Services
Windows UI Library in the Windows App SDK (WinUI 3)
Windows Application Packaging
- StackOverflow: What is Windows Application Packaging Project for?
- Deployment overview
- Packaged, Unpackaged and Self-Contained WinUI 3 Apps with the Windows App Sdk
- MSIX: The Modern Way to Deploy Desktop Apps on Windows
- MSIX: Probably you don't know, but you are already using it
- Features that require package identity
- Integrate your desktop app with Windows using packaging extensions
Messenger
.NET Configuration
Where did Microservices go
JS for ZenStack(Prisma Catalyst For Full-stack Development):
“When I transitioned from the backend development world to the full-stack world in 2021, I found that all the buzz from the popular stack like Next.js, Prisma, and tRPC seems to be around monolithic, people were no longer talking about the microservices.”
Adding Context Menu Entries to Windows Explorer
Add registry entries for folder and background context menu items
Read MoreAdd/Remove Tabs Dynamically in WPF
Using the contents of a file to define an MSBuild property
All About Span: Exploring a New .NET Mainstay
Upgrading your .NET projects with Visual Studio
How to disable Bing button in Microsoft Edge?
- Create
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge
Key - Create
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\HubsSidebarEnabled
DWORD - Open
edge://policy/
in Edge and clickReload Policies
to check setting applied
The weird world of Windows file paths
How to Sign PowerShell Script (And Effectively Run It)
CRLF vs. LF: Normalizing Line Endings in Git
Solving common problems with Kubernetes
File Handling in Xamarin.Forms
SVG Tutorial
Using paint.net from Microsoft Store in Visual Studio 'Open With' dialog
Program: explorer.exe
Arguments: paintdotnet:%1
Friendly Name: paint.net
How to Monitor UPS with Raspberry Pi
Managing Gists Locally
Or change the name of the target folder during the clone:-
My Naturewatch Camera - Download All
Commonly-supported Windows shortcuts for pasting without formatting
Paste plain text in MS Office ALT, H, V, T consecutively
Custom <kbd> style for Jekyll/Github Pages
ReaderWriterLockSlim Class
Async Programming - Brownfield Async Development
Xamarin Forms Custom Controls Tips And Tricks
Xamarin Forms Themes And Styles
Introducing .NET MAUI
String to Lines
Multiple Command Parameters
Jekyll
Windows Application Installation File Locations Reminder
- %PROGRAMFILES%
- %PROGRAMFILES(x86)%
- %APPDATA%
- %LOCALAPPDATA%
- %USERPROFILE%
- %PROGRAMDATA%
Chrome Extension - How to Scrape Data from a List of Pages
Interactive Unit Testing with .NET Core and VS Code
Using VS Code with a Legacy .NET Project
.NET Dependency Injection using Microsoft.Extensions.DependencyInjection
C# Async Tips & Tricks
Async Main and Single Threaded Apartment
Windows Portable Devices
Keeping PowerShell Up-to-date
Python 2.7 Unicode Support
Check for a Python 2.7 module
Parsing HTML in Python 2.7
Adding simple email address obfuscation for your blog like Cloudflare Scrape Shield
How to use Configuration API in .NET Core Console Application
Many-to-Many Relationships in EF Core 2.0
Xamarin Pop-up Form
LINQ Group by Month, Sum and Count
Bing Maps
Understanding the Whys, Whats, and Whens of ValueTask
Android App Data Files
WPF ItemsControl
UWP Tile Notification
UWP Background Tasks
PowerShell vCard split
Hex <--> int
Entity Framework
- EF doesn’t support unsigned types. Use long for uint.
[DatabaseGenerated(DatabaseGeneratedOption.None)]
attribute to turn off auto generated keys.DbContext.Table.RemoveRange(from c in DbContext.Table select c)
to clear table. Or((IObjectContextAdapter)DbContext).ObjectContext.ExecuteStoreCommand("TRUNCATE TABLE [Table]")
for quick and dirty.[Key]
attribute to define primary key- Use
[Table("[Table]")]
on class for table name
- https://msdn.microsoft.com/en-us/library/jj193542%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/a/20184709/146360
- https://msdn.microsoft.com/en-us/library/jj591583%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/a/21885745/146360
- https://msdn.microsoft.com/en-us/library/jj200620%28v=vs.113%29.aspx?f=255&MSPPError=-2147217396
- https://stackoverflow.com/questions/20203492/entitytype-has-no-key-defined-error
- https://social.msdn.microsoft.com/Forums/en-US/648f9f5f-b844-48cb-85c3-74c8f2ee87cc/entity-framework-code-first-stop-autoincrement-and-use-my-primary-key?forum=adodotnetentityframework
- https://stackoverflow.com/questions/26303631/how-to-use-unsigned-int-long-types-with-entity-framework
App Custom Maps
UWP Logging
- https://stackoverflow.com/questions/32886613/logger-for-windows-10-uwp-app
- https://github.com/serilog/serilog
- https://docs.microsoft.com/en-us/windows/uwp/monetize/log-custom-events-for-dev-center
- https://github.com/Fody/Anotar
- https://stackoverflow.com/questions/30543689/how-to-use-serilog-with-unity
Using async keyword in windows runtime components
Creating a background task for a UWP app requires a Windows Runtime Component as host
(for out-of-process background tasks). Among the limitations for creating Windows Runtime Components is the inability to expose Task and Task<TResult> as part of the signature of a public method.
Removing characters which are not allowed in Windows filenames
SyndicationClient.RetrieveFeedAsync returning error
UWP Localisation
XAML Styles
UWP File Access
- https://docs.microsoft.com/en-us/windows/uwp/files/fast-file-properties
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagefile.properties
- https://docs.microsoft.com/en-us/windows/uwp/files/quickstart-managing-folders-in-the-music-pictures-and-videos-libraries
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.search.queryoptions
- https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagefolder
Xamarin Auth
Xamarin Android Context
StackOverflow: Bind two checboxes to a nullable bool property in MVVM
UWP Icons
UWP Device Enumeration
UWP Background Transfer API
Grid View Item Templates
Events with async/await
Xamarin Dropbox
- https://www.dropboxforum.com/t5/API-Support-Feedback/OAuth2-0-throws-invalid-grant-type-message-while-fetching-the/td-p/268801
- https://trevorhartsblog.com/2018/03/05/xamarin-android-dropbox-api-v2/
- https://www.dropboxforum.com/t5/API-Support-Feedback/How-do-I-set-the-Redirect-URI-port-number/td-p/243556
- https://stackoverflow.com/questions/41525569/xamarin-equivalent-to-webauthenticationbroker-getcurrentapplicationcallbackuri
- https://github.com/dropbox/dropbox-sdk-dotnet
Xamarin Azure
Xamarin UWP Debug
‘In the Core Project (.NET Standard Project) Properties > Compilation > Advanced > Select “PDB Only”’
Xamarin Navigation
ILMerge
Doesn’t work with .NET Core dlls due to pdb format
- https://peteris.rocks/blog/merging-net-assemblies-with-msbuild/
- https://github.com/Microsoft/ILMerge
- https://stackoverflow.com/questions/10137937/merge-dll-into-exe
- http://dotnettower.blogspot.co.uk/2014/12/visual-studio-post-build-event.html
- https://stackoverflow.com/questions/2556048/how-to-integrate-ilmerge-into-visual-studio-build-process-to-merge-assemblies
- https://github.com/Microsoft/ILMerge/issues/11
- https://stackoverflow.com/questions/3106855/build-with-ilmerge-error
Custom domains on GitHub Pages gain support for HTTPS | The GitHub Blog
Common UI Patterns in Xamarin Forms – Part 2 – Tabbed Pages
Creating a hamburger menu in Xamarin.Forms
Xamarin Forms Toolbar
Xamarin Custom Controls
Xamarin FontSize
Xamarin
Xamarin Icons
Wpf Togglebutton
Using WPF styles
WPF ProgressBar
Observable
ListView.ItemContainerStyle
StackOverflow: How to use binding in the ListBox’s Items to the ViewModel’s properties
Uwp Navigation
"Disabled" TextBlock
CollectionViewSource
CSS Truncate Text
StackOverflow: Superscript in CSS only?
StackOverflow: String format using UWP and x:Bind
CSS Tables
CSS List
CSS Layout
CSS Background
C# Rx Socket
LINQ Join
Wpf Could not load file or assembly System.Net.Sockets
WPF Page in Frame
WPF Localisation
- http://putridparrot.com/blog/localizing-a-wpf-application-using-locbaml/
- https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/wpf-globalization-and-localization-overview
- https://wpf.2000things.com/2014/07/28/1123-localization-iv-download-and-build-the-locbaml-tool/
- https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/how-to-localize-an-application
- https://wpf.2000things.com/2014/07/24/1121-localization-ii-assigning-uids-to-all-localizable-elements/
StackOverflow: C# String Format for hours and minutes from decimal
XAML Binding
UWP ComboBox
UWP Adaptive Layout
Async/Await
- StackOverflow: The application called an interface that was marshalled for a different thread - Windows Store App
- StackOverflow: The application called an interface that was marshalled for a different thread in window 8
- StackOverflow: using await inside setters
- StackOverflow: Passing an *Awaitable* Anonymous Function as a Parameter
- StackOverflow: Correct way to get the CoreDispatcher in a Windows Store app
XAML Relative Binding
UWP Pivot
Recommendations and best practices for implementing MVVM and XAML/.NET applications
UWP use StreamSocket instead of TcpClient
When accessing a remote port from a UWP app, using TcpClient, an ExtendedSocketException ‘An attempt was made to access a socket in a way forbidden by its access permissions’ is thrown.
LINQ Expression error handling
No straightforward way of adding exception handling to a LINQ expression using query syntax.
C# UDP
UWP CollectionViewSource Notes
- ListView/ObservableCollection Sorting/Filtering/Grouping Examples?
- StackOverflow: UWP ObservableCollection sorting and grouping
- ListViews and The Task Store in a Universal Windows App
- Filtering and Sorting a ListView in a UWP – Part 1 – The UX
- Filtering and Sorting a ListView in a UWP – Part 2 – The Code
UWP Multi-line TextBox
UWP AppBarButton Focus
Stretch UWP MasterDetailsView ListViewItems to full width
Mark .NET application to run as Administrator
Add an app.manifest file to the Project and use the System.Security.Principal
namespace to check at runtime whether privileges have been provided.
Populate a UWP ComboBox from an Enum
Creating a UWP Project with the Windows Template Studio
Soldering
Via @zekjur
Azure API Management - SOAP to REST
UI described in post is already out-of-date. Azure interface setup is fussy with no detailed error messages.
Chrome Extension: No StackOverflow Hot Network Questions
Simple chrome extension to hide distracting sidebar elements on StackOverflow.
Hide StackOverflow "Hot Network Questions" in Chrome
With the side effect of learning how to create simple Chrome extensions. This answer assumes you want to see them on other StackExchange sites.
Extract info from a web page using JavaScript
Xml Manipulation using PowerShell
Csv Manipulation using PowerShell
My Bash on Windows Dev Environment
Running the Pebble SDK on Windows
PowerShell Image Module
Accessing a Powershell Class Defined in a Module from Outside a Module
Introduction to PowerShell 5 Classes
Gist Tag for Jekyll
Requires a local (i.e. non-GitHub) build.
Edit Jpeg Metadata
List Jpeg Metadata
AsyncLazy<T>: Part 2
AsyncLazy<T>: Part 1
Interop with Other Asynchronous Patterns and Types
Lazy Initialization
Build a Lightweight Dev Rig for Running Windows Docker Containers
Making a new year
jot -w 2017/%02d 12 | xargs mkdir -p
How to check if a Git pull is needed
Automate Heathergraph Update from GitHub
For heathergraph, based on How to check if a Git pull is needed. Makes a bit of a mess of logging to console but does the job.
Heathergraph: Raspberry Pi Email Print Server
Python based text email print server for Raspberry Pi and Pipsta
Stanford Python
Python Logging HOWTO
How To Add a Reset Switch To Your Raspberry Pi
Building Visual Studio Code on a Raspberry Pi 3
Expand a t.co url using cURL
curl -I <url>
or curl -v <url>
which also includes whether the server is blacklisted (not that this is necessarily correct).
> HTTP/1.1 301 Moved Permanently
...
< location: <actual url>
Create a Simple Python Server on Raspberry Pi
Raspberry Pi Email Server
Extract emails from Gmail with Python via IMAP
- Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label
- Google App Passwords
- Python Imaplib: Get new gmail mails without reconnect
- Python : How to parse the Body from a raw email, given that raw email does not have a 'Body' tag or anything
- How to check whether IMAP-IDLE works?
- Reliable IMAP synchronization with IDLE support
- Python — imaplib IMAP example with Gmail
Setup Ruby On Rails on Windows 10
Using the Raspberry Pi Camera module with Motion
Add bcm2835-v4l2
to /etc/modules
Build a Motion Capture Security System Using a Raspberry Pi
Installing Node v4 on Ubuntu on Windows from NodeSource
Troubleshooting VNC Server on the Raspberry Pi
Connecting the Raspberry Pi to an old (or not so) VGA monitor
Jekyll on Bash on Ubuntu on Windows
Resetting Ubuntu on Windows
After you inevitably break your Windows Subsystem for Linux you can ‘factory reset’ it (including the file system) by running the following from an elevated Windows command prompt.
sudo: unable to to resolve host error
On all my Ubuntu on Windows installs to date I’ve initially got a sudo: unable to resolve host [PCNAME]
error when running a command with sudo.
Bash on Windows as Integrated Terminal in Visual Studio Code
Bash for the Code Throne
Monitoring the Windows Clipboard
From Windows Vista onwards Microsoft have provided API functions to monitor changes to the Clipboard.
Dropbox Windows Folder Path
The Dropbox folder path is stored in info.json in the Dropbox Application Data and Local Application Data folders.
Emailing documents in Office 2016 using VBA
Historically the default ‘Email’ button in Word/Excel had some limitations that made it mostly unusable. It’s tendency not to save messages to ‘Sent Items’ being it’s worst fault, but also the default Subject and Body content weren’t great. To get around these limitations I’d been using a custom ‘Email Document’ button attached to an ‘EmailDocument’ macro. After upgrading to Office 2016 this stopped working.
Read MoreOld School PC Fonts
Fonts for the Font god
External Posts In Jekyll
Pebble Watchface: InR-DOS
Pebble Watchface: Weather
Copy of pebble-examples/pebblekit-js-weather with additional functionality.
How to C in 2016
The first rule of C is don’t write C if you can avoid it.
Using Tags In A Jekyll Blog On Github Pages
Revisited creating a tags page for this blog. Pretty straightforward apart from having to correct all of the post tag formats.
Petzold Code
Code by Charles Petzold is an excellent read, “a unique exploration into bits, bytes, and the inner workings of computers”. I thought it would be interesting to write an application to generate the combination of Braille, Morse and Binary found on the cover for any text input. I assumed someone would have done this already as the book is now a good 15 years old. If they have I couldn’t find it.
Fixing Windows 10 File Explorer Quick access
This PC
When Windows 8.1 came out Computer
in the Windows Explorer Navigation Pane was renamed to This PC
and a load of User folder links were added to it.
Tags in Jekyll
Has to be pre-compiled for GitHub pages sadly. Four years old so maybe it’s supported now. This is a To-Do reminder really.
Outlook 2013 not sending emails since Windows 10 upgrade
The solution suggested on various forums is to run ‘sfc /scannow’ from an Administrator Command Prompt and then restart Outlook.
Read MoreAsync Programming - Brownfield Async Development
Simple Listbox Ordering using a CollectionViewSource
As with most xaml based apps there are any number of ways of ordering a list of items. A quick and straightforward way to do this entirely in xaml is to use a CollectionViewSource.
Read MoreEmbedding Gists in Jekyll Posts
Cloud Storage Windows Folder Paths
Dropbox
OneDrive
The OneDrive folder path was originally stored in the registry under SkyDrive, but this is no longer the case.
Retrieving the contents of the OneDriveConsumer
environment variable seems the most straightforward method.
Useful Visual Studio Solution and Project Posts
A couple of posts from Kirill Osenkov on Visual Studio Solution and Project configuration.
TextBlock StringFormat Support in Windows Phone 8.1 Projects
In trying to create a custom control for a Windows Phone 8.1 project I was having an odd problem where StringFormat didn’t seem to be supported by the TextBlock control Text property any more so the following “Unsupported” style raised an error against StringFormat=T:
Read MoreThe Post Title Is The File Name
And the Front Matter ‘title’ variable overrides it the same as the ‘date’ variable. Which makes sense if you think about it.
Read MoreRemoving Local Font Awesome Files
Jekyll Now didn’t include support for Font Awesome icons so I ha(a?)cked them in by copying the method used by Haacked.
Read MoreInstalling Jekyll On Raspberry Pi
Posted From The Post Link
Test post using the “Post” link at the top of the page.
Read MoreRead.md Markdown Parser
Rough and ready parser for read.md using RegEx for read.md
Regex For Read.md
Post From My Phone
GitHub, not unreasonably, has a read-only mobile site. Writing this on the desktop site on my phone is fairly awful. Even ignoring my terrible memory wrt the header values.
Read MorePost from my iPad
Bit of a cheat as I’ve just done the phone post and so therefore can just about remember all the criteria for a valid post. Maybe try again later and see how that goes.
Read MoreMarkdown Cheatsheet
(Test of external URL posts).
Setting up a blog using Jekyll on GitHub
There are various ways of doing this. This one has been done by forking the Jekyll Now repository on GitHub.
Read More