This file contains hidden or 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
# https://hub.docker.com/_/microsoft-dotnet | |
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
# copy csproj and restore as distinct layers | |
COPY ComplexApp.Core/*.csproj ComplexApp.Core/ | |
COPY ComplexApp.Web/*.csproj ComplexApp.Web/ | |
RUN dotnet restore ComplexApp.Web |
This file contains hidden or 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.Authorization; | |
using Microsoft.AspNetCore.Mvc.Authorization; | |
using Microsoft.Identity.Web; | |
using Microsoft.Identity.Web.UI; | |
var builder = WebApplication.CreateBuilder(args); | |
IEnumerable<string>? initialScopes = builder.Configuration["DownstreamApi:Scopes"]?.Split(' '); | |
builder.Services.AddMicrosoftIdentityWebAppAuthentication(builder.Configuration, "AzureAd") | |
.EnableTokenAcquisitionToCallDownstreamApi(initialScopes) |
This file contains hidden or 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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"applicationName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name of the application." | |
} | |
}, |
This file contains hidden or 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
package automationFramwork; | |
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
public class RegistrationTestCase { |
This file contains hidden or 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 class MultiplicationTests { | |
@Test | |
public void MultiplicationOfZeroIntegerShouldReturnZero() { | |
assertEquals(0, Main.Multiplication(10, 0)); | |
assertEquals(0, Main.Multiplication(0, 10)); | |
assertEquals(0, Main.Multiplication(0, 0)); | |
} | |
@Test |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
for(var i = 0; i < jsonObj.length ; i++){ | |
(function(i) { | |
imdb.getImdbInfo(jsonObj[i].imdbId).then(function (data) { | |
console.log('done ' + i); | |
jsonObj[i].title = data.Title; | |
}); |
This file contains hidden or 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
<!doctype html> | |
<html ng-app="app"> | |
<head> | |
</head> | |
<body> | |
<h1 ng-controller="HelloWorldCtrl">{{helloMessage}}</h1> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> | |
<script type="text/javascript"> | |
angular.module('app', []).controller('HelloWorldCtrl', |
This file contains hidden or 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
var http = require('http'); | |
var fs = require('fs'); | |
const PORT = 8000; | |
function send404Response(response){ | |
response.writeHead(404, {"Context-Type": "text/plain"}); | |
response.write("Error 404: Page not found!"); | |
response.end(); | |
} |
NewerOlder