Skip to content

Instantly share code, notes, and snippets.

View SeppPenner's full-sized avatar
😜
I like cookies 🍪🍪🍪🍪

SeppPenner SeppPenner

😜
I like cookies 🍪🍪🍪🍪
View GitHub Profile
@SeppPenner
SeppPenner / license-badges.md
Created June 24, 2019 08:41 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

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

@SteveSandersonMS
SteveSandersonMS / blazor-auth.md
Created June 11, 2019 10:49
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

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

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 April 26, 2019 14:13
OpenCover beeing stuck in infinite loop?
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 March 27, 2019 15:18
IEnumerable gives error exception handeling can't read list
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 March 19, 2019 13:07
OpenSSL-Create certificate with brainpoolP512r1 and a certificate revocation list (CRL) for it
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 January 7, 2021 14:22
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, ...
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 January 25, 2019 15:41
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?
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)
{
@SeppPenner
SeppPenner / README.md
Last active January 11, 2019 08:05
Using CodePages in C# (e.g. .netCore/ NetCore) to provide special Windows encodings (e.g. 1252)
  1. Add the nuget package System.Text.Encoding.CodePages to your project
  2. Use it like this example:
public class Test
{
	public Test()
	{
		Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
	}
@lukas-h
lukas-h / license-badges.md
Last active January 19, 2023 14:18
Lizenz-Buttons für dein Projekt

Markdown Lizenz-Buttons

Sammlung von Lizenz-Schildern (Badges) für die README-Datei deines Projekts. Diese Liste enthält die meist verbreiteten Open Source und Open Data Lizenzen. Kopieren und fügen Sie den Code unter den Badges einfach in Ihre Markdown-Dateien ein.

Notes