Skip to content

Instantly share code, notes, and snippets.

😜
I like cookies 🍪🍪🍪🍪

HansM SeppPenner

😜
I like cookies 🍪🍪🍪🍪
Block or report user

Report or block SeppPenner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SeppPenner
SeppPenner / Startup.cs
Created Jul 17, 2019
Blazor localization test
View Startup.cs
namespace Example.Application
{
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@SeppPenner
SeppPenner / Something.md
Created Jul 16, 2019
Backup of 在AspNetCore 2.2中使用MQTTnet
View Something.md

       MQTTnet可以说是.Net 开发者的福音,在众多MQTT开源项目中,也有.Net的一份子。感谢 Christian!当发现这个开源项目时,我非常有兴趣。于是我开始了一个实验的项目。我并不是一个软件开发高手,项目代码写得很糟糕。所以并没有开源分享。以下我简单介绍关键代码的实现。同时也提出我遇到的问题,我们来共同学习吧!

创建一个设备信息表:Devices.cs

public class Devices
{
	[Key]
	public int Id { get; set; }

	[Display(Name = "Tid")]
@SeppPenner
SeppPenner / CheckTopic.cs
Last active Jun 28, 2019
MQTT: Matching a topic to a topic filter in C# based on Eclipse Mosquitto's function.
View CheckTopic.cs
/// <summary>
/// Does a check if topics match a certain topic filter.
/// </summary>
/// <param name="allowedTopic">The allowed topic.</param>
/// <param name="topic">The topic.</param>
/// <returns><c>true</c> if the topic is valid, <c>false</c> if not.</returns>
public static bool TopicMatch(string allowedTopic, string topic)
{
if (string.IsNullOrWhiteSpace(allowedTopic) || string.IsNullOrWhiteSpace(topic))
{
@SeppPenner
SeppPenner / license-badges.md
Created Jun 24, 2019 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project
View license-badges.md

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

@SeppPenner
SeppPenner / README.md
Last active May 28, 2019
How to really install Thingsboard with Postgres
View README.md

Approach:

  1. Install Java.
  2. Install Postgres.
  3. Create folder (e.g. C:\Thingsboard) --> Not under C:\Programm Files or C:\Programm Files (x86) as this will not work due to spaces in the path name.
  4. Download Thingsboard as zip (See https://thingsboard.io/docs/user-guide/install/windows/) and unzip it under the folder from 3.
  5. Adjust the file thingsboard.yml in the conf folder (Comment out HSQLDB DAO Configuration, Uncomment PostgreSQL DAO Configuration and adjust username and password (Host too, if needed).
  6. Create the database thingsboard via pgAdmin or the command line in Postgres (Or rename it to something else and adjust the host parameter configuration, too).
  7. Install Thingsboard using .\install.bat (Powershell in admin mode needed).
  8. Start service with net start thingsboard.
@SeppPenner
SeppPenner / Configuration.md
Last active Apr 26, 2019
OpenCover beeing stuck in infinite loop?
View Configuration.md
C:\Jenkins\workspace\someproject>OpenCover.Console.Exe -target:"C:\program files\dotnet\dotnet.exe" -targetargs:"test \"src\SomeProject.Tests\SomeProject.Tests.csproj\" --configuration Debug --no-build" -output:"src\TestResults\SomeProject.Tests.coveragexml" -oldstyle -register:user 
@SeppPenner
SeppPenner / Example.cs
Last active Mar 27, 2019
IEnumerable gives error exception handeling can't read list
View Example.cs
namespace ListExample
{
using System.Collections.Generic;
public class Program
{
private static readonly List<Animal> AnimalsToCheck = new List<Animal>
{
new Animal { Eater = Eater.Carnivore, Format = 1 },
new Animal { Eater = Eater.Herbivore, Format = 3 }
@SeppPenner
SeppPenner / License.txt
Created Mar 19, 2019
OpenSSL-Create certificate with brainpoolP512r1 and a certificate revocation list (CRL) for it
View License.txt
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@SeppPenner
SeppPenner / License.txt
Last active Mar 7, 2019
C# MigraDoc break line in table cell if the text is too long for a cell and does not contain some split chars, e.g. commas, hypens, ...
View License.txt
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@SeppPenner
SeppPenner / CustomCellRenderer.cs
Created Jan 25, 2019
How can I disable the splitting of rows (not tables!) in Itext7 for C# when one row is to big to fit on the first page?
View CustomCellRenderer.cs
namespace PrueDi.Export.Pdf
{
using iText.Layout.Element;
using iText.Layout.Layout;
using iText.Layout.Renderer;
public class CustomCellRenderer : CellRenderer
{
public CustomCellRenderer(Cell modelElement) : base(modelElement)
{
You can’t perform that action at this time.