Skip to content

Instantly share code, notes, and snippets.

@liebki
liebki / dotnet_install_and_publish.sh
Created January 29, 2024 10:28
Automated .NET 8 Installation and WebAssembly Project Setup
curl -sSL https://dot.net/v1/dotnet-install.sh > dotnet-install.sh; chmod +x dotnet-install.sh; ./dotnet-install.sh -c 8.0 -InstallDir ./dotnet8; ./dotnet8/dotnet - version; ./dotnet8/dotnet workload install wasm-tools; ./dotnet8/dotnet publish -c Release -o output;
@liebki
liebki / PreferencesStoreClone.cs
Created July 23, 2023 10:48
Alternative to Session- and Localstorage on MAUI-Blazor
public class PreferencesStoreClone
{
/// <summary>
/// Store an element using any kind of key (if it doesnt exist)
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
public void Set(string key, object value)
{
@liebki
liebki / nuget-tocsharp-project.md
Created September 30, 2022 10:18
Create C#-Project using NuGet .nupkg

Create C#-Project using NuGet .nupkg

Recently I stumbled upon a NuGet using the google search for something I wanted to try, sadly the projects code was no longer available on GitHub, the project was gone, but the NuGet was up and available.

So I thought, what if I'd like to work on this certain project/NuGet how can I get the source code..

Steps

  1. Download the .nupkg file of the project
  2. Use an archive tool like WinRAR or 7-Zip to open the .nupkg
@liebki
liebki / SystemFolderReader.razor
Created January 21, 2022 12:35
Custom component for razor (blazor server-side), to read folders (or files) in local filesystem
@code {
[Parameter]
public string? path { get; set; }
}
<h3>Folders in @path</h3>
<ul>
@foreach(string folder in data) {
<li>@folder</li>
}
@liebki
liebki / SystemFileReader.razor
Created January 21, 2022 12:30
Custom component for razor (blazor server-side), to read files (or folders) in local filesystem
@code {
[Parameter]
public string? path { get; set; }
}
<h3>@data</h3>
@code {
public string? data { get; set; }
protected override async Task OnInitializedAsync()