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 / ps-download-all-nuget-packages
Created Sep 12, 2019 — forked from SteveH3032/ps-download-all-nuget-packages
Nov 2018 - PowerShell script to download all NuGet packages
View ps-download-all-nuget-packages
$indexClient = new-object system.net.webclient
$jsonIndex=$indexClient.DownloadString("https://api.nuget.org/v3/catalog0/index.json") | ConvertFrom-Json
for ($h=0; $h -lt $jsonIndex.items.Length; $h++) {
$web_client = new-object system.net.webclient
$jsonObj=$web_client.DownloadString($jsonIndex.items[$h].'@id') | ConvertFrom-Json
for ($i=0; $i -lt $jsonObj.items.Length; $i++) {
$package = $jsonObj.items[$i]."nuget:id" + "/" + $jsonObj.items[$i]."nuget:version"
$web_client.DownloadFile("https://www.nuget.org/api/v2/package/" + $package, ("C:\Nuget\" + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version" + ".nupkg"))
"Processing: " + ($h + 1) + " of " + $jsonIndex.count + " ---- " + ($i + 1) + " of " + $jsonObj.count + " - " + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version"
}
@SeppPenner
SeppPenner / ps-download-all-nuget-packages
Last active Sep 12, 2019 — forked from bevand/ps-download-all-nuget-packages
Powershell script to download all packages from a nuget feed
View ps-download-all-nuget-packages
$destinationDirectory = "C:\LocalNuGetTest\"
$webClient = New-Object System.Net.WebClient
$webClient.Credentials = New-Object System.Net.NetworkCredential("USERNAME", "PASSWORD")
$feed =[xml]$webClient.DownloadString("https://hostednugetfeed.com/custom-feed/nuget/v2/Packages")
$records = $feed | select -ExpandProperty feed | select -ExpandProperty entry #| select -ExpandProperty content
for ($i=0; $i -lt $records.Length; $i++) {
$content = $records[$i] | select -ExpandProperty content
$properties = $records[$i] | select -ExpandProperty properties
@SeppPenner
SeppPenner / MethodDescription.md
Created Aug 10, 2019
Server and client method documentation.
View MethodDescription.md

Client

Client options

Method name Description Default value
Build() Builds the options class. Does not apply here.
WithAuthentication(string method, byte[] data) Allows to use different authentication modes. null
WithCleanSession(bool value = true) Allows to use the client with MQTT clean session support. true
WithClientId(string value) Sets the used client id. Guid.NewGuid().ToString("N")
WithCommunicationTimeout(TimeSpan value) Sets the communication timeout. TimeSpan.FromSeconds(10.0)
@SeppPenner
SeppPenner / CONTRIBUTING.md
Created Aug 7, 2019 — forked from briandk/CONTRIBUTING.md
A basic template for contributing guidelines that I adapted from Facebook's open source guidelines
View CONTRIBUTING.md

Contributing to Transcriptase

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the code
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

We Develop with Github

View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@SeppPenner
SeppPenner / Index.de.resx
Created Aug 2, 2019
Resource file for Index.razor example
View Index.de.resx
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
View upgrade_raspbian_to_buster.sh
sudo sync
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sed -i 's/jessie/buster/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sync
#sudo reboot
@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))
{
You can’t perform that action at this time.