Skip to content

Instantly share code, notes, and snippets.

View GavinRay97's full-sized avatar

Gavin Ray GavinRay97

View GitHub Profile
@GavinRay97
GavinRay97 / readme.md
Last active November 8, 2023 20:58
Making Apache Calcite work in SQuirreL SQL Client

Making Apache Calcite work in SQuirreL SQL Client

Recently I wanted to test some Calcite functionality, and thought it might be nice to use a GUI instead of sqlline. It turns out, it is:

image

I figured you could just use something like SquirreL, which lets you import arbitrary JDBC drivers. This was less straightforward than I thought.

@GavinRay97
GavinRay97 / doc.md
Last active September 26, 2023 16:58
JDK Valhalla: Design document on nullability and value types (fixed formatting)
@GavinRay97
GavinRay97 / Makefile
Created December 8, 2022 21:21
A Makefile to compile a Maven/Gradle-style project layout using a custom JDK (for use w/ IE, Valhalla)
# Makefile to compile and run Java sources manually
# because JDK 20 Valhalla support is not yet available in IntelliJ IDEA
JAVA_VERSION = 20
JAVAC = /home/user/downloads/jdk-20-vahalla-20-75/bin/javac
JAVA = /home/user/downloads/jdk-20-vahalla-20-75/bin/java
JAVA_COMPILE_OPTIONS = --enable-preview --release $(JAVA_VERSION)
JAVA_OPTIONS = --enable-preview
JAVA_MAIN_CLASS = org.example.Database
@GavinRay97
GavinRay97 / README.md
Last active August 10, 2023 18:44
Kotlin wishlist
@GavinRay97
GavinRay97 / MX Tuner.lua
Created August 6, 2023 22:34
MX Tuner infobox mod
--[[
@author Ilias-Timon Poulakis (FeedTheCat)
@license MIT
@version 1.8.0
@provides [main=main,mediaexplorer] .
@about Simple tuner utility for the reaper media explorer
@changelog
- Alt-click on a key now adds 'key' metadata (not automatic on MacOS)
- Alt-click on the metadata icon now removes 'key' metadata
- Improved FFT pitch detection algorithm (better harmonics detection)
@GavinRay97
GavinRay97 / Makefile
Last active July 26, 2023 22:00
WASM copy structs to memory from host -> module
WASI_VERSION_FULL = 20.0
WASMTIME_DIR = ../third-party/wasmtime-dev-x86_64-linux-c-api
WASI_SDK_PATH = ./wasi-sdk-$(WASI_VERSION_FULL)
CC = clang++
WASM_CC = $(WASI_SDK_PATH)/bin/clang++ --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot
CFLAGS = -std=c++20 -I$(WASMTIME_DIR)/include -L$(WASMTIME_DIR)/lib
LIBS = -lwasmtime
@GavinRay97
GavinRay97 / write-ahead-log.cpp
Created February 8, 2023 15:28
C++ Database Write-Ahead-Log simple proof of concept
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>
#include <span>
#include <string>
// A write-ahead log is a log of all the operations that have been performed on the database.
struct LogEntryHeader
@GavinRay97
GavinRay97 / build.gradle.kts
Created January 23, 2023 14:46
Kotlin Gradle - How to use preview JDK's
val JDK_21_PATH = "/home/user/.sdkman/candidates/java/21.ea.6-open"
tasks.withType<org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain>().configureEach {
kotlinJavaToolchain.jdk.use(JDK_21_PATH, JavaVersion.VERSION_21)
}
@GavinRay97
GavinRay97 / example-module.cxx
Created January 21, 2023 17:43
C++ Modules Example
// Compile with:
// $ /opt/gcc-latest/bin/g++ --std=c++2b -fmodules-ts other-module.cxx example-module.cxx -o example
// Global module fragment where #includes can happen
module;
#include <iostream>
// first thing after the Global module fragment must be a module command
export module example;
import other_module;