Skip to content

Instantly share code, notes, and snippets.

View jessenich's full-sized avatar
😶‍🌫️
I may be slow to respond.

Jesse N. jessenich

😶‍🌫️
I may be slow to respond.
View GitHub Profile
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"name": "Attach to app1",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
@jessenich
jessenich / luhn_check.sh
Created March 18, 2021 03:46
Bash Luhn Check
function luhn_validate # <numeric-string>
{
num=$1
shift 1
len=${#num}
is_odd=1
sum=0
for((t = len - 1; t >= 0; --t)) {
digit=${num:$t:1}
#!/usr/bin/bash
###
# Provides completion assistance for openapi-generator-cli
# Install
# Mac:
# brew install bash-completion
# cp openapi-generator-cli-completion.bash `brew --prefix`/etc/bash_completion.d
# Linux: many distributions include this automatically. Search for your distro-specific instructions.
# When in doubt, try sourcing this file:
@jessenich
jessenich / 401filter.cs
Created March 18, 2021 12:14
AppInsights HTTP 401 Response Filter
public void Process(ITelemetry item)
{
var request = item as RequestTelemetry;
if (request != null &&
request.ResponseCode.Equals("401", StringComparison.OrdinalIgnoreCase))
{
// To filter out an item, just terminate the chain:
return;
}
@jessenich
jessenich / form-element-creator.js
Last active June 4, 2021 23:13
Example JS creating elements dynamically for Sam O'Neill
export const formState = {
itemCount = 1
};
export function addItem () {
let currentIteration = itemCount;
const containerElement = document.createElement("div");
containerElement.setAttribute("id", `iteration_${currentIteration}`);
@jessenich
jessenich / install-az-devops-runner.ps1
Last active June 4, 2021 23:19
Azure DevOps Pipelines Runner PowerShell Install Script
function Install-AzDevOpsWindowsRunner {
[CmdletBinding()]
Param(
[Paramater(Mandatory=$true)]
[ValidateScript({ Test-Path $PSItem })]
$directory,
[Parameter(Mandatory=$true)]
[ValidateNotNull()]
$agentName,
# Use root/example as user/password credentials
version: "3.1"
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
@jessenich
jessenich / adding-nuget-packages.md
Last active April 19, 2021 07:05
### Gists somehow lost their proper order, follow by section #'s in the headers.

Section 2: Adding the NuGet packages

Enough with the theory, let's put the plan into action.

From Solution Explorer, right-click on the WorldCities tree node, then select Manage NuGet Packages, look for the following two packages, and install them:

  • Microsoft.AspNetCore.Identity.EntityFrameworkCore
  • Microsoft.AspNetCore.ApiAuthorization.IdentityServer
@jessenich
jessenich / ApplicationInsights.config
Last active June 4, 2021 23:05
AppInsights HTTP400 Response Success Inverter
<ApplicationInsights>
<TelemetryInitializers>
<!-- Fully qualified type name, assembly name: -->
<Add Type="KeplerDev.AppInsights.Http400SuccessInversionTelemetryInitializer, KeplerDev.AppInsights"/>
</TelemetryInitializers>
</ApplicationInsights>
@jessenich
jessenich / hello_world.c
Last active January 6, 2022 12:02
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}