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 System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MediatR; | |
using Microsoft.ApplicationInsights; | |
using Microsoft.ApplicationInsights.DataContracts; | |
using Microsoft.AspNetCore.Http; |
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
:: Install choco .exe and add choco to PATH | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" | |
:: Install all the packages | |
:: choose: visual studio, office, .net core, .net, rider tools | |
:::: Dev tools | |
choco install git.install -y | |
choco install gitkraken | |
choco install vscode -y |
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 static class AppSettingsHelper | |
{ | |
public static string SomeStingValueFromWebConfig => Get<string>("SomeStringValue"); | |
public static int SomeIntValueFromWebConfig => Get<string>("SomeIntValue"); | |
private static TValue Get<TValue>(string key) | |
{ | |
try | |
{ | |
var value = ConfigurationManager.AppSettings[key]; |
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 static int Int(this string stringValue, int defaultValue = 0) | |
{ | |
if (stringValue == null) return defaultValue; | |
int integer = Int32.TryParse(stringValue, out integer) ? integer : defaultValue; | |
return integer; | |
} |
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 |