Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Coding

Georg Dangl GeorgDangl

😎
Coding
View GitHub Profile
View Jenkinsfile
pipeline {
triggers {
cron('0 0 1 * *')
}
agent {
node {
label 'master'
customWorkspace 'workspace/JenkinsBackup'
}
}
View E2eTestsBase.cs
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Xunit;
View first_approach.cs
_requestUrl
.Subscribe(async url =>
{
var response = await httpClient.GetAsync(url);
// Update the list
});
View RevitApi_Correct.cs
var callbackStack = new Stack<Action>();
uiapp.Idling += (s, e) =>
{
if (callbackStack.Any())
{
var action = callbackStack.Pop();
action.Invoke();
}
};
@GeorgDangl
GeorgDangl / NuGet.Config
Created Nov 5, 2019
Dangl.AVA NuGet Feed Example
View NuGet.Config
<?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>
View DatabaseContext.cs
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 Jul 26, 2019
Perfoming End-to-End Tests for a .NET Core Web API with an Angular Frontend in Docker with Jenkins
View Build.cs
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
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/
View ExportToOenorm.cs
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);
}
View CreateGaebFile.cpp
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";
View PublishElectronApp.cs
[PathExecutable("electronize")] readonly Tool ElectronNET;
Target PublishElectronApp => _ => _
.DependsOn(Clean)
.DependsOn(GenerateVersion)
.Requires(() => DocuBaseUrl)
.Requires(() => DocuApiKey)
.Executes(async () =>
{
// Electron Build
You can’t perform that action at this time.