This is intended as a quick reference and showcase. For more complete info, see John Gruber's original spec and the Github-flavored Markdown info page. This cheatsheet is modified from Joshua Pekera'a cheat sheet for "Markdown Here", but this page is just GitHub Flavored Markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <binding BeforeBuild='default' /> | |
"use strict"; | |
var _ = require('lodash'), | |
gulp = require('gulp'), | |
uglify = require('gulp-uglify'), | |
cssmin = require('gulp-cssmin'), | |
rename = require('gulp-rename'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IDistributedCache | |
{ | |
T? GetOrCreate(string key, Func<DistributedCacheEntryOptions, T> factory) | |
{ | |
var bytes = Get(key); | |
if (bytes is { Length: > 0 }) | |
{ | |
var payload = Encoding.UTF8.GetString(bytes); | |
return JsonSerializer.Deserialize<T>(payload); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Requests the navigator.mediaDevices for video input. | |
*/ | |
export async function requestVideoDevices() { | |
try { | |
// Ask the first time to prime the underlying device list. | |
let devices = await navigator.mediaDevices.enumerateDevices(); | |
if (devices && | |
(devices.length === 0 || devices.every(d => d.deviceId === ""))) { | |
await navigator.mediaDevices.getUserMedia({ |
This is a sample app, trying to demonstrate the smallest ASP.NET Core Minimal API, a "Hello World!" example. The Program.cs* is only three lines of code.
Program.cs:
var app = WebApplication.CreateBuilder(args).Build();
app.MapGet("/", () => "Hello World!");
app.Run();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GitHub: 👨🏽💻 https://github.com/ievangelist | |
// Twitter: 🤓 https://twitter.com/davidpine7 | |
// SDK: 🛠️ https://github.com/IEvangelist/azure-cosmos-dotnet-repository | |
using System.ComponentModel.DataAnnotations; | |
using Microsoft.Azure.CosmosRepository; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddCosmosRepository(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nullable enable | |
using System; | |
using System.Net.Http; | |
using System.Net.Http.Json; | |
using System.Text.Json; | |
JsonSerializerOptions _options = new() | |
{ | |
PropertyNameCaseInsensitive = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Example.App; | |
using IHost host = Host.CreateDefaultBuilder(args) | |
.ConfigureServices(services => services.AddHostedService<Worker>()) | |
.Build(); | |
await host.RunAsync(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
static IEnumerable<int> Fibonacci(int max) | |
{ | |
int current = 1, next = 1; | |
while (current < max) | |
{ | |
yield return current; | |
next = current + (current = next); |
NewerOlder