Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View GeorgDangl's full-sized avatar
😎
Coding

Georg Dangl GeorgDangl

😎
Coding
View GitHub Profile
@GeorgDangl
GeorgDangl / first_approach.cs
Last active January 30, 2020 21:03
Cancel Obsolete Http Requests in Rx.NET with the Switch Operator, see https://blog.dangl.me/archive/cancel-obsolete-http-requests-in-rxnet-with-the-switch-operator/
_requestUrl
.Subscribe(async url =>
{
var response = await httpClient.GetAsync(url);
// Update the list
});
var callbackStack = new Stack<Action>();
uiapp.Idling += (s, e) =>
{
if (callbackStack.Any())
{
var action = callbackStack.Pop();
action.Invoke();
}
};
@GeorgDangl
GeorgDangl / NuGet.Config
Created November 5, 2019 08:41
Dangl.AVA NuGet Feed Example
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.myget.org/F/dangl-ava/auth/<YOUR_API_KEY>/api/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
if (Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite")
{
// SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations
// here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations
// To work around this, when the Sqlite database provider is used, all model properties of type DateTimeOffset
// use the DateTimeOffsetToBinaryConverter
@GeorgDangl
GeorgDangl / Build.cs
Last active July 26, 2019 20:56
Perfoming End-to-End Tests for a .NET Core Web API with an Angular Frontend in Docker with Jenkins
Target E2ETests => _ => _
.DependsOn(BuildDocker)
.DependsOn(Clean)
.Executes(async () =>
{
IProcess dockerComposeProcess = null;
// Start the docker environment in a non-blocking way
var dockerComposeUpTask = Task.Run(() =>
{
dockerComposeProcess = ProcessTasks.StartProcess("docker-compose", "up");
@GeorgDangl
GeorgDangl / ExportToOenorm.cs
Last active May 29, 2019 07:36
Convert between German GAEB files and Austrian ÖNorm 2063 with the libraries by Dangl IT GmbH, see https://www.dangl-it.com/articles/convert-between-oenorm-2063-and-gaeb-files-with-danglava-dangloenorm-and-danglgaeb/
private async Task TransformToOenormAsync()
{
var convertedProject = Dangl.Oenorm.Converter.ConvertToOenorm(_readProject, OenormDestinationType.LV2015);
using (var oenormStream = Dangl.Oenorm.Writer.OenormWriter.GetStream(convertedProject))
{
var outputPath = Path.GetFullPath(_options.OutputFilePath);
using (var fileStream = File.Create(outputPath))
{
await oenormStream.CopyToAsync(fileStream);
}
Console::WriteLine(L"Creating new GAEB file:");
GaebTargetType targetType = GaebTargetType::GaebXml;
Project^ projectToExport = gcnew Project();
ServiceSpecification^ servSpec = gcnew ServiceSpecification();
servSpec->ExchangePhase = ExchangePhase::Grant;
projectToExport->ServiceSpecifications->Add(servSpec);
Position^ position = gcnew Position();
position->ShortText = "C++ Position";
position->ItemNumber->StringRepresentation = "01";
[PathExecutable("electronize")] readonly Tool ElectronNET;
Target PublishElectronApp => _ => _
.DependsOn(Clean)
.DependsOn(GenerateVersion)
.Requires(() => DocuBaseUrl)
.Requires(() => DocuApiKey)
.Executes(async () =>
{
// Electron Build
@GeorgDangl
GeorgDangl / GAEB.xml
Last active January 16, 2019 20:20
Integrating BIM and IFC references in GAEB data
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Dangl GAEB Tool, Copyright 2013 - 2019 Dangl IT GmbH, www.dangl-it.com, Version 1.6.2 (Built: 15.01.2019 19:00)-->
<GAEB xmlns="http://www.gaeb.de/GAEB_DA_XML/DA83/3.2">
<GAEBInfo>
<Version>3.2</Version>
<VersDate>2013-10</VersDate>
<Date>2019-01-16</Date>
<Time>21:18:22</Time>
<ProgSystem>Dangl GAEB Tool - www.dangl-it.com - Version 1.6.2</ProgSystem>
<ProgName>Dangl.AVA.Converter www.dangl-it.com V2.0.2 ©2019</ProgName>
@GeorgDangl
GeorgDangl / ClientDependency.config
Last active January 11, 2019 20:33
Caching bundled and minified JavaScript and CSS in the free tier on CloudFlare with the ClientDependency package in Umbraco and other IIS-hosted websites, see https://blog.dangl.me/archive/caching-bundled-and-minified-css-and-javascript-with-the-wrong-file-extension-in-the-free-tier-on-cloudflare-with-umbraco/
<mvc defaultRenderer="StandardRenderer">
<renderers>
<add name="StandardRenderer" type="Dangl.Blog.NonAxdDependenciesRenderer, Dangl.Blog" />
<add name="LazyLoadRenderer" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadRenderer, ClientDependency.Core" />
</renderers>
</mvc>