How to run some Node code in Docker because you're smart and don't want to have evil Node installed on your PC.
NODE DOCKER VERSIONS: https://hub.docker.com/_/node
docker run --rm -it -v ${PWD}:/src/someProject --name npm-stuff node /bin/bash
var builder = DistributedApplication.CreateBuilder(args); | |
var sqlPassword = builder.AddParameter("sql-password", secret: true); | |
var sqlserver = builder | |
.AddSqlServer("sqlserver", password: sqlPassword) | |
.WithDataVolume() | |
.WithLifetime(ContainerLifetime.Persistent); | |
var importSourceConnectionString = "Server=[REPLACE].database.windows.net;Authentication=Active Directory Interactive;Database=[REPLACE];Encrypt=True;" | |
var db = sqlserver |
NODE DOCKER VERSIONS: https://hub.docker.com/_/node
docker run --rm -it -v ${PWD}:/src/someProject --name npm-stuff node /bin/bash
This document now exists on the official ASP.NET core docs page.
function Prompt(){ | |
$W = Split-Path -leaf -path (Get-Location) | |
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green | |
$prompt += Write-Prompt $W -ForegroundColor DarkCyan | |
$prompt += Write-Prompt '>' | |
return ' ' | |
} | |
function Remove-StoppedContainers { | |
docker container rm $(docker container ls -q) |
public static class DeltaHelper | |
{ | |
public static (IEnumerable<TItem> Left, IEnumerable<TItem> Both, IEnumerable<TItem> Right) Compute<TItem, TValue>( | |
IEnumerable<TItem> list1, | |
IEnumerable<TItem> list2, | |
Func<TItem, TValue> getItemValue) | |
where TValue : IEquatable<TValue> | |
{ | |
var comparableList1 = list1.Select(x => new EqualityComparer<TItem, TValue> | |
{ |
(C) 2015 by Derek Hunziker, (C) 2017 by AppsOn
As of releasing MongoDB 3.4 and C# Driver v2.4, original cheatsheet by Derek is outdated. In addition, it has some deficiencies like connecting to MongoDB, creating indexes, etc. This updated version works fine with C# Driver v2.4.7 and MongoDB v3.4.
Note: Defined models and collections will be used in entire cheatsheet.
namespace Analogy | |
{ | |
/// <summary> | |
/// This example shows that a library that needs access to target .NET Standard 1.3 | |
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
/// </summary>INetCoreApp10 | |
class Example1 | |
{ | |
public void Net45Application(INetFramework45 platform) |
private static readonly string[] tenHoursOfFun = | |
{ | |
"https://www.youtube.com/watch?v=wbby9coDRCk", | |
"https://www.youtube.com/watch?v=nb2evY0kmpQ", | |
"https://www.youtube.com/watch?v=eh7lp9umG2I", | |
"https://www.youtube.com/watch?v=z9Uz1icjwrM", | |
"https://www.youtube.com/watch?v=Sagg08DrO5U", | |
"https://www.youtube.com/watch?v=5XmjJvJTyx0", | |
"https://www.youtube.com/watch?v=IkdmOVejUlI", | |
"https://www.youtube.com/watch?v=jScuYd3_xdQ", |
public class RavenTestBase { | |
Task<IDocumentStore> _createDocumentStore; | |
ctor() { | |
var source = new TaskCompletionSource<IDocumentStore>(); | |
_createDocumentStore = source.Task; | |
Task.Run(async () => { | |
var store = InitializeDocumentStore(); |
############################################################################ | |
### ### | |
### NUGET PACKAGE and PUBLISH ### | |
### ### | |
############################################################################ | |
param ( |