Skip to content

Instantly share code, notes, and snippets.

View savaged's full-sized avatar
418

David Savage savaged

418
View GitHub Profile
@savaged
savaged / BusyStateManager.cs
Created August 30, 2018 10:50
Busy State Manager - WPF helper (mini framework) for managing IsBusy state
// BusyStateManager usings
using System.Collections.Generic;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using Savaged.Info.Desktop.Messages;
// BusyMessage usings
using System;
using System.Runtime.CompilerServices;
using GalaSoft.MvvmLight.Messaging;
@savaged
savaged / FizzBuzz.cs
Last active October 12, 2022 10:00
Fizz Buzz
// Using top-level statements (see https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/top-level-statements)
// and Linq along with pattern matching (see https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching)
Enumerable.Range(1, 100).Select(
i =>
(i % 3, i % 5) switch
{
(0, 0) => "FizzBuzz",
(0, _) => "Fizz",
(_, 0) => "Buzz",
@savaged
savaged / LocalCachedPropertiesService.cs
Created May 24, 2019 07:59
Local Cached Properties Service (local props ini file)
using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
namespace AssureDesktop.Data
{
public class LocalCachedPropertiesService
: ILocalCachedPropertiesService
{
private const string _fileLocation = "LocalCachedProperties.ini";
@savaged
savaged / OopFizzBuzz.cs
Created July 16, 2019 14:26
Oop Fizz Buzz
namespace OopFizzBuzz
{
class Program
{
static void Main(string[] args)
{
const int lastNumber = 17;
var app = new Program();
@savaged
savaged / BoolTypeAttribute.cs
Last active August 16, 2019 16:10
Just a quick referencce on defining and using a custom bool like Attribute
using System;
using System.Collections.Generic;
using System.Linq;
namespace Savaged.Sandpit
{
class Program
{
static void Main(string[] args)
{
@savaged
savaged / PropertiesService.cs
Created November 15, 2019 15:30
Local Cached Properties Service
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
namespace savaged.Services.IO
{
class PropertiesService : IPropertiesService
{
@savaged
savaged / FizzBuzz.py
Last active January 8, 2020 19:36
Python FizzBuzz (functional style)
def getVerb(i):
value = ""
r = i % 3
if r == 0:
value = "Fizz"
r = i % 5
if r == 0:
value = value + "Buzz"
if value == "":
@savaged
savaged / Patterns.Switch.Lib.cs
Last active January 31, 2020 13:39
Simple C# 8.0 pattern matching switch example
using System;
namespace Patterns.Switch.Lib
{
public class GreetingService
{
public string GetGreeting(string? name)
{
var value = name switch
{
@savaged
savaged / Program.cs
Last active August 17, 2022 10:48
Azure Storage Queues Hello World
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Queue;
using Newtonsoft.Json;
using System;
using System.Threading;
namespace MyCo_Workflow
{
class Program
{
@savaged
savaged / remmina-azure-ad.md
Last active April 10, 2024 13:14 — forked from primaryobjects/readme.md
How to remote desktop from Linux to Windows 10 with AzureAD Azure AD login

How to remote desktop from Linux to Windows 10 with AzureAD

The following steps detail how to connect over Remote Desktop from Linux Mint or Ubuntu to Windows 10 with an AzureAD username and password login account.

  1. In Windows 10, right-click This PC or My Computer and select Properties.
  2. Click Remote Settings.
  3. Check the option Allow remote connections to this computer.
  4. Uncheck the option Allow connections only from computers running Remote Desktop with Network Level Authentication.
  5. Click OK.