Skip to content

Instantly share code, notes, and snippets.

View jeffreyschultz's full-sized avatar

Jeffrey Schultz jeffreyschultz

  • Newport News, VA
View GitHub Profile
@jeffreyschultz
jeffreyschultz / launch.json
Created January 10, 2020 15:40
Working VSCode launch config for WSL
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3001",
"webRoot": "${workspaceFolder}/src",
"sourceMapPathOverrides": {
"top/localhost:3001/mnt/c/*": "C:/*",
"/mnt/c/*": "C:/*",
"file://mnt/c/*": "C:/*",
@jeffreyschultz
jeffreyschultz / gist:ac48f04b4b3a9097197674ccc83b0852
Created July 25, 2019 17:36
OpenSSL s_connect with certificate and ca
openssl s_client -connect localhost:8443 -cert jtt-ui.pem -key jtt-ui.key -state -debug -tls1_2 -CAfile ca_certificate.pem
/// <summary>
/// Class that renders MVC views to a string using the standard MVC View Engine to render the view.
/// </summary>
public class ViewRenderer
{
/// <summary>
/// Required Controller Context
/// </summary>
protected ControllerContext Context { get; set; }
public class Builder<T>
{
public Builder()
{
Controller = new BuilderStep<Controller>(this);
}
public BuilderStep<ListingSearchController> Controller { get; }
public T Build()
@jeffreyschultz
jeffreyschultz / git-branch-prune.sh
Last active November 20, 2018 17:14
Prunes git branches that have been merged
#!/usr/bin/env bash
git branch --merged | egrep -v "(^\*|master|green|blue)" | xargs git branch -d
/* (C) Copyright 2012-2014 Semantic Designs, Inc.
You may freely use this code provided you retain this copyright message
*/
typedef unsigned int natural;
natural InstructionLength(BYTE* pc)
{ // returns length of instruction at PC
natural length=0;
natural opcode, opcode2;
@jeffreyschultz
jeffreyschultz / gist:aeb3a29bce9d1cec306101e621e0aad3
Created November 6, 2018 16:59
Remove common-logging from Spring and use Log4j2
compile group: 'org.springframework', name: 'spring-core'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.1' // SLF4J 1.7.x
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer;
import java.util.function.Predicate;
public class RetryRunnable implements Runnable {
private final long sleep;
private final Runnable r;
private final int times;
private final Predicate<Throwable> p;
mvn clean install -DskipTests -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true