Skip to content

Instantly share code, notes, and snippets.

View MiYanni's full-sized avatar

Michael Yanni MiYanni

  • Microsoft
  • Seattle, WA
View GitHub Profile
@baronfel
baronfel / spec.md
Last active March 27, 2024 18:53
.NET SDK Compound Templates

Core Idea

Allow templates to easily orchestrate the invocation of other templates by name/id, making multi-project and multi-item templates easier to keep up to date, and factoring out subsets of currently-giant templates into maintainable chunks.

Motivating Examples

  • A JS API with a corresponding .NET Backend
  • A Library project, a console project, and a test project
@fearthecowboy
fearthecowboy / FluentConsole.ps1
Created June 9, 2022 19:16
FluentConsole for PowerShell
<##
FluentConsole Functions
(C) 2022 Garrett Serack
License: MIT
Usage:
dot source this into your script (. FluentConsole.ps1 )
and then you can use the colon-prefixed functions.
You can separate colon-function calls with ';' or '|' or a newline.
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe-&gt;&gt;dotcom: iframe ready

The numbers in brackets denote the split index of the section if using the autosplitter script. Using the autosplitter script is at your own risk as we haven't figured out how the anti-cheat works.

LOOP 0 (Intro)

Coast (1)

  • Meet Juliana in her library

LOOP 1 (Intro)

@jimmyca15
jimmyca15 / Certificate.cs
Created December 13, 2017 02:10
Code for creating a self signed certificate in .NET Core using CertEnroll APIs
namespace CreateCert
{
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
class Certificate
{
public static async Task<X509Certificate2> Create(string subject, string friendlyName, IEnumerable<string> alternativeNames)
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 13, 2025 09:49
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux

Converting ServiceClientCredentials to SubscriptionCloudCredentials for Azure Management Clients

When using Azure SDK clients that depend on different runtimes (Microsoft.Azure.Common, Microsoft.Rest.ClientRuntime) together, authentication can be a problem, because the authentication libraries for both runtimes are highly encapsulated, and only one authentication should be required for all the Azure management clients used.

To resolve this, you can use an adapter like the following that converts ServiceClientCredentials (required for the Microsoft.Rest.ClientRuntime clients) to SubscriptionCloudCredentials (required by Microsoft.Azure.Common clients).

@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@mdo
mdo / 00-intro.md
Last active March 4, 2025 19:03
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@fabien-d
fabien-d / github.pr.toggle.file.extension.js
Last active May 14, 2018 17:58
Filter GitHub pull request changed files by extension
/**
* Prompt and filter a PR's changed files by the given extension(s).
*/
var els=document.getElementsByClassName('user-select-contain');
var input = prompt('File extension(s), comma separated');
els = [].forEach.call(els, function(el) {
var parent = el;
while (parent && !parent.classList.contains('js-details-container')) {