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
<h3>State Machine</h3> | |
<button (click)="moveBack()">Back</button> | |
<button (click)="moveNext()">Next</button> | |
<p>State: {{currentState}}</p> |
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
<div class="cbx-container"> | |
<div class="input-group"> | |
<!--combobox style view --> | |
<input class="form-control cbx-input" type="text" | |
autocomplete="off" | |
(click)="closeOptionsDialog()" | |
[(ngModel)]="state.displayValue" | |
(input)="onValueTypedChange($event.target.value)" | |
#inputBox="ngModel" /> | |
<button type="button" class=" btn btn-outline-dark cbx-button" |
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
// backup copy of https://github.com/denniske/ngx-translate-multi-http-loader | |
import {HttpClient} from "@angular/common/http"; | |
import {TranslateLoader} from "@ngx-translate/core"; | |
import {Observable, forkJoin, of} from "rxjs"; | |
import {catchError, map} from "rxjs/operators"; | |
import merge from 'deepmerge'; | |
export interface ITranslationResource { |
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
#The command to delete all branches except master on linux is: | |
#git branch | grep -v "master" | xargs git branch -D | |
#To use the same command in Windows use powershell and CD to your repo | |
#Or, WINDOWS - we can use PowerShell command that do the same thing that above command do: | |
# Tried this and it worked nicely... | |
git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ } | |
#or WINDOWS - | |
#git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()}) |
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 void SendData(string authToken, MyDataClass myData) | |
{ | |
try | |
{ | |
var url = $"https://www.something.com/api/something/post"; | |
HttpClient client = new HttpClient(); | |
//client.BaseAddress = new Uri(url); | |
// Add an Accept header for JSON format. |
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.Caching.Memory; | |
using Microsoft.Extensions.Primitives; | |
using System; | |
namespace CacheTest | |
{ | |
public class CacheHelper | |
{ | |
private IMemoryCache _memoryCache { get; } = new MemoryCache( |
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
$webAppObjectId = (Get-AzADServicePrincipal -DisplayName $webAppName).Id |
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.AspNetCore.Mvc; | |
namespace TestForAPIM.Controllers | |
{ | |
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private static readonly string[] Summaries = new[] | |
{ |
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 Akka.Actor; | |
using AkkaHelloWorld; | |
Console.WriteLine("Enter a string to update the actor, or 'ask' to get its value"); | |
var system = ActorSystem.Create("MySystem"); | |
var greeter = system.ActorOf<SimpleMessageActor>("simplemsg"); | |
greeter.Tell(new SimpleMessage("Starting")); |
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
// 0. Create Application insights (workspace version - You could set up a 'log analytics workspace' first) | |
// 1. In web app, Nuget -> Microsoft.ApplicationInsights.AspNetCore | |
// 2. Config (can either pass in app insights key, or use whole connection string in config) | |
// 3. (if using connectionstring, appsettings.json looks like) | |
//"ApplicationInsights": { | |
// "ConnectionString": "InstrumentationKey=...;IngestionEndpoint=https://...-0.in.applicati...ights.azure.com/;LiveEndpoint=https://........livediagnostics.monitor.azure.com/" | |
// }, | |