Skip to content

Instantly share code, notes, and snippets.

View spottedmahn's full-sized avatar

Michael DePouw spottedmahn

View GitHub Profile
@JAgostoni
JAgostoni / choco.txt
Last active January 23, 2024 20:06
Windows / Mac Installs
choco install vscode visualstudio2019enterprise slack microsoft-windows-terminal git gitkraken gpmdp microsoft-teams.install inkscape 7zip adobereader nodejs gimp python zoom onedrive awscli chocolateygui azure-cli microsoftazurestorageexplorer postman razer-synapse-2 dotnetcore-sdk jdk windscribe terraform kubernetes-helm azure-data-studio
@gabrieljoelc
gabrieljoelc / mstest_fixture_steps.md
Last active September 14, 2022 20:56
How to get .NET Core MSTest tests working locally and in Azure DevOps (previously Visual Studio Team Services or VSTS)

These steps are for getting .NET Core 2.1 MSTest tests to support building up the environment variables that an Azure Function uses both in a local environment and in Azure DevOps CI.

Assumptions

  • Need to use live resources for integration testing because Event Hub doesn't have an emulator
    • This means I have connection strings that must be treated like secrets (can't use UseDevelopment=true for everything)
  • Can't easily build up my own configuration using ConfigurationBuilder in the application because I'm using Azure Functions (and Webjobs)
    • Can't use something like this
  • Need to be able to run locally and in Azure DevOps (VSTS)
@ahelland
ahelland / APIMFunction_01.csx
Created December 20, 2017 17:20
Azure Function for making an http request to an API behind Azure API Management
using System;
using System.Text;
using System.Net.Http;
using System.Net.Http.Headers;
public static void Run(string input, TraceWriter log)
{
log.Info($"C# manually triggered function called with input: {input}");
var apimUrl = " https://contosio.azure-api.net/foo/messages";
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@hikalkan
hikalkan / AccountController.cs
Created January 13, 2016 16:25
Adding a new property to session
//Add new property to claims on login
private async Task SignInAsync(User user, ClaimsIdentity identity = null, bool rememberMe = false)
{
if (identity == null)
{
identity = await _userManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
}
identity.AddClaim(new Claim("Application_UserEmail", user.EmailAddress)); //SETTING NEW PROPERTY
@n3dst4
n3dst4 / renaming.markdown
Last active February 21, 2024 13:56
How to rename Visual Studio solutions and projects

How to rename solutions and projects in Visual Studio

  1. Don't.

How to rename solutions and projects that were created in Visual Studio

  1. Close Visual Studio and don't open it again until I tell you. Visual Studio is not competent at renaming things.
  2. Assuming you're using git, clean the working folder to remove anything that's not in version control (this will help the search-and-replace step because it won't have to go through a bunch of generated files)

git clean -fdx

@stefanbirkner
stefanbirkner / ReadmeDrivenDevelopment.md
Created May 26, 2014 16:46
Readme Driven Development

Readme Driven Development

Problem

Build software that helps people.

Solution

@tekkies
tekkies / indented-checkboxes.md
Last active October 5, 2023 02:59
Indented markdown checkbox example

Nested checkbox rendering would be nice (view the sourcer for this gist)

  • Task 1
  • Task 2
    • Subtask a
    • Subtask b
  • Task 3

There's no need to complete parents when child nodes are all checked.

@jminadeo
jminadeo / observable--ms-ex.linq
Created November 9, 2012 17:25
Observable example from MS for linqpad
void Main()
{
IObservable<Ticket> ticketObservable = Observable.Create((Func<IObserver<Ticket>, IDisposable>)TicketFactory.TicketSubscribe);
using(IDisposable handle = ticketObservable.Subscribe(ticket => Console.WriteLine(ticket.ToString())))
{
Console.WriteLine("\nPress ENTER to unsubscribe...\n");
Console.ReadLine();
}
}