This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using OpenMeteo; | |
OpenMeteoClient client = new(); | |
try | |
{ | |
if (await client.QueryAsync("Menziken", new() { Current = CurrentOptions.All, Daily = DailyOptions.All }) is WeatherForecast weatherForecast) | |
{ | |
Console.WriteLine($"found Menziken at {weatherForecast.Latitude} & {weatherForecast.Longitude}"); | |
Console.WriteLine(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
@if (NotSelectedItems().Any()) | |
{ | |
<select @bind="@currentIndex" @bind:after="@AddItem"> | |
<option selected hidden disabled value="-1"></option> | |
@foreach (var item in NotSelectedItems()) | |
{ | |
<option value="@item.Index">@item.Item</option> | |
} | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using HomeTests; | |
using JsonTests; | |
using System.Text.Json; | |
using WebDeviceTests; | |
var options = JsonSerializerOptions.Web.WithPolymorphicTypesFor<Event>(configure => | |
{ | |
configure | |
.IncludeTypesFromNamespaceWith<WebButtonEvent>() | |
.IncludeType<HomeStateEvent>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
using System.Text.Json.Serialization.Metadata; | |
/* demo */ | |
var options = JsonSerializerOptions.Web.WithPolymorphictypeInfoFor<Event>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class ErrorLogger | |
{ | |
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
static internal void LogError(string message, params object[] parameters) => logError(message, parameters); | |
internal delegate void LogErrorDelegate(string message, params object[] parameters); | |
static readonly LogErrorDelegate logError = DontLogError; | |
private static void DontLogError(string message, params object[] parameters) { } | |
static ErrorLogger() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Conesoft.Files; | |
using Conesoft.Hosting; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Walterlv.WeakEvents; | |
namespace Conesoft.Plugin.AdminPage.Features.ServiceWatcher.Services; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const char *ssid; | |
const char *ssidpass; | |
const char *webrequest; | |
bool loadsettings() { | |
if(FS.exists("/ssid") == false && FS.exists("/ssidpass") == false && FS.exists("/webrequest") == false) { | |
return false; | |
} | |
ssid = FS.read("/ssid"); | |
ssidpass = FS.read("/ssidpass"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
namespace ProcessTracking; | |
// From https://stackoverflow.com/a/37034966/1528847 | |
class ProcessTracker(bool closeOnExit = true) | |
{ | |
ChildProcessTracker? current = closeOnExit ? new() : null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Server.Kestrel.Https; | |
using System.Diagnostics; | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Text; | |
using Yarp.ReverseProxy.Forwarder; | |
var demo = new | |
{ | |
port = 5005, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
border-radius: 0 !important; | |
/* youtube */ | |
--yt-spec-base-background: black; | |
/* twitch */ | |
--color-background-body: black; | |
--color-background-base: black; | |
--color-background-alt: black; | |
--border-radius-small: 0; | |
--border-radius-medium: 0; |
NewerOlder