Skip to content

Instantly share code, notes, and snippets.

View dandohotaru's full-sized avatar

Dan Dohotaru dandohotaru

  • Brussels, Belgium
View GitHub Profile
@dandohotaru
dandohotaru / descriptors.json
Last active February 3, 2022 17:05
services.descriptors
{
"results": [
{
"lifetime": "transient",
"contract": "MediatR.ISender"
},
{
"lifetime": "transient",
"contract": "MediatR.IPublisher"
},
//+---------------------------------+
//| Name PValue RValue NValue Group |
//+---------------------------------+
//| Low 100 600 300 Car |
//| High 900 400 700 Car |
//| Low 200 300 500 Truck|
//| High 800 700 500 Truck|
//+---------------------------------+
void Main()
//<?xml version="1.0"?>
//<catalog>
// <book id="bk101">
// <author>Gambardella, Matthew</author>
// <title>XML Developer's Guide</title>
// <genre>Computer</genre>
// <price>44.95</price>
// <publish_date>2000-10-01</publish_date>
// <description>An in-depth look at creating applications
// with XML.</description>
//Product ##
//ProductId
//ProductName
//IsDeleted(bit)
//
//ProductTag
//ProductTagId
//ProductId
//TagName
//IsDeleted(bit)
void Main()
{
var persons = new[]
{
new Person{Id= 1, Name="John Doe", Age=21},
new Person{Id= 2, Name="Jane Doe", Age=22},
new Person{Id= 3, Name="Jim Doe", Age=23},
};
var map = new Func<Person, dynamic>(person =>
void Main()
{
var data = new[]
{
new Asset{Id=1, Name="one"},
new Asset{Id=2, Name="two"},
new Asset{Id=3, Name="three"},
new Asset{Id=4, Name="four"},
new Asset{Id=5, Name="five"},
new Asset{Id=6, Name="six"},
void Main()
{
var ctx = new DemoContext();
var inner1 = ctx.Filter<Bar>(value: "Const1");
var inner2 = ctx.Filter<Bar>(value: "Const2");
var inner3 = ctx.Filter<Bar>(value: "Const3");
var query = from foo in ctx.Foos
select new
// Same as initial recursive attempt but playing around with graph creation
void Main()
{
var trip = new
{
Origin = "CMB",
Destination = "DEL",
};
// How could I map my area from a Tile[,] to a int[,], where only the height is saved?
void Main()
{
var area = new Tile[7, 10];
var rows = area.GetLength(0);
var columns = area.GetLength(1);
var random = new Random();
// Rely on http://xmltocsharp.azurewebsites.net/ for xml to C# mappings
void Main()
{
var xml = @"
<SalesQuotes xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://api.some.com/version/1'>
<Pagination>
<NumberOfItems>2380</NumberOfItems>
<PageSize>200</PageSize>
<PageNumber>1</PageNumber>
<NumberOfPages>12</NumberOfPages>