Cloning a Single File from a Git Repository

history edit

Git

  1. git init
  2. git remote add origin <remote-uri>
  3. git sparse-checkout set 1
  4. git sparse-checkout add <file-path>
  5. git fetch origin main 2
  6. git checkout main
  1. This is a simpler sparse initialisation, but includes more files by default. 

  2. This will, still, download the complete repo history. 

Windows SDK to OS Version

history edit

Windows, Windows SDK

  • 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 Packages Location Settings Precedence

history edit

NuGet

  1. NUGET_PACKAGES User environment variable
  2. NUGET_PACKAGES System environment variable
  3. %APPDATA%\NuGet\NuGet.Config file config/globalPackagesFolder setting
  4. %ProgramFiles(x86)%\NuGet\Config file config/globalPackagesFolder setting

Check current location (new terminal needed for environmental variable change):- nuget locals global-packages -l

Read More

Using a Raspberry Pi as a Print Server

history edit

Raspberry Pi, Printing, CUPS

Setting up CUPS isn’t necessary with the current Raspberry Pi OS image. Working drivers for ARM are the main problem.

paint.net plugins - Windows Store version

history edit

paint.net

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.

Construct your Windows app's icon

history edit

Windows, Icons

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.

Read More

Git Global User

history edit

Git

  • User
    • Get: git config --global user.name
    • Set: git config --global user.name {display name}
    • Clear: git config --global user.name ""
  • Email
    • Get: git config --global user.email
    • Set: git config --global user.email {email address}
    • Clear: git config --global user.email ""

try-convert Tool

history edit

.NET Framework, .NET, MSBuild, Visual Studio

Tool to migrate .NET Framework projects to .NET “Core”.

How to disable Bing button in Microsoft Edge?

history edit

Edge, Bing

  1. Create Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge Key
  2. Create Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\HubsSidebarEnabled DWORD
  3. Open edge://policy/ in Edge and click Reload Policies to check setting applied

Entity Framework

history edit

Entity, Framework

  1. EF doesn’t support unsigned types. Use long for uint.
  2. [DatabaseGenerated(DatabaseGeneratedOption.None)] attribute to turn off auto generated keys.
  3. 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.
  4. [Key] attribute to define primary key
  5. Use [Table("[Table]")] on class for table name

Xamarin Dropbox

history edit

Xamarin, Dropbox

Xamarin UWP Debug

history edit

UWP, Xamarin

‘In the Core Project (.NET Standard Project) Properties > Compilation > Advanced > Select “PDB Only”’

ILMerge

history edit

MSBuild, .NET Framework

Doesn’t work with .NET Core dlls due to pdb format

WPF Localisation

history edit

WPF