Skip to content

Instantly share code, notes, and snippets.

View HarrisonMc555's full-sized avatar

Harrison McCullough HarrisonMc555

View GitHub Profile
@HarrisonMc555
HarrisonMc555 / ReflectionFactory.patch
Created October 18, 2021 19:55
Patch to improve error message for failing to instantiate constructor for abstract class
diff --git a/jdk/internal/reflect/ReflectionFactory.java b/jdk/internal/reflect/ReflectionFactory.java
--- a/jdk/internal/reflect/ReflectionFactory.java
+++ b/jdk/internal/reflect/ReflectionFactory.java
@@ -225,7 +225,8 @@
Class<?> declaringClass = c.getDeclaringClass();
if (Modifier.isAbstract(declaringClass.getModifiers())) {
- return new InstantiationExceptionConstructorAccessorImpl(null);
+ return new InstantiationExceptionConstructorAccessorImpl
+ ("Can not instantiate abstract class");
@HarrisonMc555
HarrisonMc555 / welcome-to-rust.html
Created February 26, 2020 19:24
Welcome to Rust | Slides
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Rust</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
@HarrisonMc555
HarrisonMc555 / welcome-to-rust.md
Created February 26, 2020 19:23
Welcome to Rust | Slide notes

Welcome To Rust

Overview

  1. Background
    • What is Rust?
    • Why Rust?
  2. Examples
  3. Comparison to other languages
    • Comparisons to languages with manual memory management
@HarrisonMc555
HarrisonMc555 / sticky-footer.css
Created October 17, 2017 23:06
CSS for sticky footer
node -p process.versions.v8
@HarrisonMc555
HarrisonMc555 / log-every-command.sh
Last active June 19, 2018 23:05
Save everything command entered at the terminal
mkdir -p ~/.logs
export PROMPT_COMMAND='
CODE=$?
if [ "$(id -u)" -ne 0 ]; then
COMMAND_NUMBER=$(history 1 | awk '\''{ print $1 }'\'')
COMMAND=$(history 1 | awk '\''{ s = ""; for (i = 2; i <= NF; i++) s = s $i " "; print s }'\'')
COMMAND=${COMMAND%%*( )}
printf "$(date "+%H:%M:%S")\t$(pwd)\t${COMMAND_NUMBER}\t${COMMAND}\t${CODE}\n" >> \
~/.logs/bash-history-$(date "+%Y-%m-%d").log
fi'