Instantly share code, notes, and snippets.

View wait_for_jquery_load.js
async function checkJquery(tries, tryLimit) {
console.log("Waiting for jQuery to Load");
//1. Base Case - JQuery Loaded
if (window.jQuery) {
console.log("jQuery Loaded");
//2. Base Case - TryLimit Hit
if(parseInt(tries) > parseInt(tryLimit)) {
View .gitconfig
tool = p4merge
[difftool "p4merge"]
path = C:\\Program Files\\Perforce\\p4merge.exe
tool = p4merge
[mergetool "p4merge"]
path = C:\\Program Files\\Perforce\\p4merge.exe
View blog_github_sonarqube_start_script.ps1
$github_branch_refs_parts = "" -split "/"
$is_pr = ($github_branch_refs_parts.Count -eq 2 -and $github_branch_refs_parts[1] -eq "merge")
if (-Not $is_pr) {
Write-Host "Running SonarQube in master branch mode"
SonarQube.Scanner.MSBuild.exe begin /k:"%sonar.project%" /d:"" /d:sonar.cs.dotcover.reportsPaths="dotCover.html" /v:"%build.number%"
} else {
Write-Host "Running SonarQube in PR Mode"
$pull_request_number = $github_branch_refs_parts[0]
View blog_webdriver_session_error.txt
OpenQA.Selenium.WebDriverException : A exception with a null response was thrown sending an HTTP request
to the remote WebDriver server for URL http://localhost:51027/session/71f17e73965ce00cdd20434b035cdce2/element
View blog_idserver_3_to_4_api_resource.json
"Name": "MyApiRescource",
"ApiSecrets": [
"Value": "MyAPIResouceSecret"
"Scopes": [
"Name": "MyScopeName",
View blog_example_aspnet_core_2_startup_configure.cs
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
View blog_auth_successful_user_null.txt
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
Authorization was successful for user: (null).
View idisposable_teardown_xunit.cs
public class TruthTests : IDisposable
public TruthTests()
public void Dispose()
//Do cleanup actions here
View running_aspnetcore_server_port_at_command_line
# Unix:
ASPNETCORE_URLS="https://*:5123" dotnet run
# Windows PowerShell:
$env:ASPNETCORE_URLS="https://*:5123" ; dotnet run
# Windows CMD (note: no quotes):
SET ASPNETCORE_URLS=https://*:5123 && dotnet run
View static_c_types_c#.cs
// User defined type
int myUserDefinedTypeNumber = 1;
string myUserDefinedTypeString = "Hello";
bool myUserDefinedTypeBool = true;
// Compiler defined type
var myCompilerDefinedTypeNumber = 1;
var myCompilerDefinedTypeString = "Hello";
var myCompilerDefinedTypeBool = true;