When initializing collections, use explicit typing over implicit typing (var) and use collection expressions. Otherwise, use implicit typing (var).
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://medium.com/asos-techblog/testing-authorization-scenarios-in-asp-net-core-web-api-484bc95d5f6f | |
| // https://github.com/dylan-asos/netcore-authz-inmemory-bddfy/blob/master/src/Asos.DotNetCore.Auth.Api.ComponentTests/BearerTokenBuilder.cs | |
| using Microsoft.IdentityModel.Tokens; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using System.Linq; | |
| using System.Security.Claims; | |
| using System.Security.Cryptography.X509Certificates; |
sam build was resulting in this error:
Building codeuri: C:\code\AwsToolkitJava runtime: None metadata: {'DockerTag': 'java11-maven-v1', 'DockerContext': 'C:\\code\\AwsToolkitJava\\HelloWorldFunction', 'Dockerfile': 'Dockerfile'} functions: ['HelloWorldFunction']
Building image for HelloWorldFunction function
Setting DockerBuildArgs: {} for HelloWorldFunction function
Step 1/10 : FROM amd64/maven as build-image
---> 0615804734cc
Step 2/10 : WORKDIR "/task"
---> Using cache
$path = [Environment]::GetEnvironmentVariable('PATH', 'Machine')
$newpath = $path + ';C:\Program Files\Fabrikam\Modules'
[Environment]::SetEnvironmentVariable("PATH", $newpath, 'Machine')I think this is bettern than the answer posted here on SO because $Env:Path returns a combination of User- & Machine- scoped PATHs.
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 FeatureAContextProvider : IFeatureContextProvider<FeatureAContext> | |
| { | |
| private readonly HttpContextBase _httpContext; | |
| public FeatureAContextProvider(HttpContextBase httpContext) | |
| { | |
| // this would be a "decoraptor" (in quotes because it's wrapping ambient context 🤢) | |
| _httpContext = httpContext; | |
| } |
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
| // KISS | |
| services.AddMyService(sdkKey); | |
| // builder | |
| services.AddMyService(config => config.UseSdkKey(sdkKey)); | |
| // fluent | |
| services.AddMyService() | |
| .UseSdkKey(sdkKey); |
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
| // This code is API-compatible with .NET Standard 1.2. | |
| // https://docs.microsoft.com/en-us/dotnet/standard/net-standard#which-net-standard-version-to-target | |
| using System; | |
| using System.Linq; | |
| namespace Palindrome | |
| { | |
| public class PalindromeChecker : IPalindromeChecker | |
| { |
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
| //Installed node modules: jquery underscore request express jade shelljs passport http sys lodash async mocha moment connect validator restify ejs ws co when helmet wrench brain mustache should backbone forever debug | |
| process.stdin.resume(); | |
| process.stdin.setEncoding('utf8'); | |
| var util = require('util'); | |
| var input = ""; | |
| process.stdin.on('data', function (text) { | |
| input += text; | |
| }); |
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
Show hidden characters
| { | |
| "useState()": { | |
| "prefix": "us", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState($2);", | |
| "$0" | |
| ], | |
| "description": "React: useState()" | |
| }, |
NewerOlder