Skip to content

Instantly share code, notes, and snippets.

View EifelMono's full-sized avatar

Andreas Klapperich EifelMono

View GitHub Profile
@EifelMono
EifelMono / Program.cs
Last active November 19, 2019 09:35
WithIndex
using System;
using System.Collections.Generic;
using System.Linq;
namespace PlayWithIndex
{
class Program
{
static void Main()
{
@EifelMono
EifelMono / Program.cs
Last active October 3, 2019 07:49
Generate Schema from class with enums as string
// nuget:Newtonsoft.Json.Schema
using System;
using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Schema.Generation;
//nuget Newtonsoft.Json.Schema v2.0.8
public class Program
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Reflection;
using System.Runtime.Versioning;
namespace JsonSerializeDeserialize
{
public class Test
{
using System;
public class Example
{
public static void Main()
{
var x = Math.Round(11.1, MidpointRounding.AwayFromZero);
}
}
<Grid>
<StackPanel>
<Button Margin="10" Width="100" Height="30" Content="Click Me" x:Name="btn"/>
<TextBlock Margin="10" Text="Hello, styled world!" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Blue"></Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red" />
using System;
public class trydotnet_running_on_unix
{
public static void Main()
{
Console.WriteLine(Environment.OSVersion.ToString());
}
}
@EifelMono
EifelMono / Program.cs
Last active March 20, 2019 12:18
Sample for Guid and the Length of the Guid
using System;
using System.Linq;
public class Program
{
public static void Main()
{
var guid= Guid.NewGuid();
Console.WriteLine($"Guid={guid}");
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
Environment.GetCommandLineArgs()[0]
var ip= "192.168.179.1";
var name = "abcdefgd";
var commandTitle = $"echo -n -e \"\\033]0;[{name}]\\007\"";
var commandPing = $"ping {ip}";
File.WriteAllText("ping.command", $"{commandTitle}\n{commandPing}\n");
var commandLine= $"chmod +x ping.command; open ping.command";
new Process()
{
@EifelMono
EifelMono / .gitignore(cake)
Created December 9, 2017 17:03
cake to ignore in .gitignore
# cake.build
**/tools/**
!**/tools/packages.config
tools/**
!tools/packages.config