Skip to content

Instantly share code, notes, and snippets.

View MartinZikmund's full-sized avatar
⌨️
Coding

Martin Zikmund MartinZikmund

⌨️
Coding
View GitHub Profile
var s="var s={0}{1}{0};Write(s,(char)34,s);";Write(s,(char)34,s);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
var s="var s={0}{1}{0};Console.Write(s,(char)34,s);";Console.Write(s,(char)34,s);
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
var s="var s={0}{1}{0};System.Console.Write(s,(char)34,s);";System.Console.Write(s,(char)34,s);
class c{static void Main(){var s="class c{{static void Main(){{var s={0}{1}{0};System.Console.Write(s,(char)34,s);}}}}";System.Console.Write(s,(char)34,s);}}
class c
{
static void Main()
{
var s = "class c{{static void Main(){{var s={0}{1}{0};System.Console.Write(s,(char)34,s);}}}}";
System.Console.Write(s, (char)34, s);
}
}
@MartinZikmund
MartinZikmund / BadgeUpdater.ts
Created September 1, 2021 22:35
BadgeUpdater.ts
interface Navigator {
setAppBadge(value: number): void;
clearAppBadge(): void;
}
namespace Windows.UI.Notifications {
export class BadgeUpdater {
public static setNumber(value: number) {
if (navigator.setAppBadge) {
navigator.setAppBadge(value);
public partial class BadgeUpdater
{
private const string JsType = "Windows.UI.Notifications.BadgeUpdater";
partial void SetBadge(string? value)
{
if (int.TryParse(value, out var number))
{
WebAssemblyRuntime.InvokeJS($"{JsType}.setNumber({number})");
}