Skip to content

Instantly share code, notes, and snippets.

View pavoldecky's full-sized avatar

Pavol Decky pavoldecky

View GitHub Profile
@pavoldecky
pavoldecky / gist:76b2f8f0cc34231490bb86dc2b35e638
Created May 8, 2022 17:07
Send messages to AZure Service Hub with REST in rest.client in VS CODE
# "rest-client.environmentVariables": {
# "local":{
# "aadV2ClientSecret":"",
# "aadV2ClientId":"",
# "aadV2TenantId":"",
# "aadV2AppUri":"",
# "namespace": "",
# "topicName": ""
# }
# }
@pavoldecky
pavoldecky / integration
Last active November 9, 2021 09:48
Autoupdater.NET MVC Integration
[Route("updates/{xml?}")]
public IActionResult Updates(string xml)
{
string host = @"";
string username = "";
string password = @"";
string remoteDirectory = $"/updates/{xml}";
MemoryStream memoryStream = new System.IO.MemoryStream();
using (SftpClient sftp = new SftpClient(host, username, password))
@pavoldecky
pavoldecky / ConEmu_profile.ps1
Last active November 5, 2021 20:06
ConEmu_profile.ps1
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
Import-Module posh-git
Import-Module oh-my-posh
Import-Module DockerCompletion
Import-Module Z
# Import-Module -Name Terminal-Icons
# Import-Module posh-with
# Description: Boxstarter Script
# Author: Laurent Kempé
# Dev settings for my app development
Disable-UAC
#--- Windows Features ---
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
#--- File Explorer Settings ---
@pavoldecky
pavoldecky / delegates.cs
Created May 4, 2016 07:35
Fun with delegates
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunWithDelegates
{
class Program
{
@pavoldecky
pavoldecky / upload.cs
Created March 3, 2016 18:23
Create ZIP file from files uploaded in ASP.NET MVC
[HttpPost]
public ActionResult Upload(UploadModel model, IEnumerable<HttpPostedFileBase> files)
{
try
{
var guid = Guid.NewGuid();
if (files != null && files.Any())
{
using (var ms = new MemoryStream())