Skip to content

Instantly share code, notes, and snippets.

View GavinRay97's full-sized avatar

Gavin Ray GavinRay97

View GitHub Profile
@GavinRay97
GavinRay97 / main.go
Created September 12, 2020 19:04
CloudFormation RDS type
// This file was generated from Typescript using quicktype, do not modify it directly.
// To parse and unparse this JSON data, add this code to your project and do:
//
// cloudFormationRDSDBInstance, err := UnmarshalCloudFormationRDSDBInstance(bytes)
// bytes, err = cloudFormationRDSDBInstance.Marshal()
//
// dBEngine, err := UnmarshalDBEngine(bytes)
// bytes, err = dBEngine.Marshal()
//
// dBInstanceProperties, err := UnmarshalDBInstanceProperties(bytes)
package mypackage
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.internal.*
typealias CustomColumnNames = HashMap<String, String>
typealias ColumnPresetsExpression = HashMap<String, String>
typealias RemoteField = HashMap<String, RemoteFieldValue>
typealias InputArguments = HashMap<String, String>
@GavinRay97
GavinRay97 / auth.module.ts
Last active February 22, 2024 10:57
Hasura Nest.js JWT Auth utils (REST + GQL)
import { Module } from '@nestjs/common'
import { AuthService } from './auth.service'
@Module({
providers: [AuthService],
exports: [AuthService],
})
export class AuthModule {}
@GavinRay97
GavinRay97 / VitalSample.types.ts
Created February 13, 2021 05:29
Vital .vital sample Type Definition example
export interface VitalPresetTypes {
author: string;
comments: string;
macro1: string;
macro2: string;
macro3: string;
macro4: string;
preset_style: PresetStyle;
settings: { [key: string]: SettingElement[] | Sample | number };
synth_version: string;
@GavinRay97
GavinRay97 / script.py
Created February 21, 2021 14:03
Python - Convert directory of drumkit single-instrument MIDI parts to General MIDI drumkits
#!/usr/bin/env python3
import pathlib
from glob import glob
from dataclasses import dataclass
from mido import MidiFile, MidiTrack, merge_tracks
from typing import Dict, List
pathlib.Path("./_Processed").mkdir(parents=True, exist_ok=True)
@GavinRay97
GavinRay97 / omnisharp.json
Created March 3, 2021 00:15
C# - Omnisharp settings for not-fucked-up, terrible, awful formatting (IE like JS/TS/Java/Swift/literally every other C-based language)
{
"FormattingOptions": {
"NewLinesForBracesInLambdaExpressionBody": false,
"NewLinesForBracesInAnonymousMethods": false,
"NewLinesForBracesInAnonymousTypes": false,
"NewLinesForBracesInControlBlocks": false,
"NewLinesForBracesInTypes": false,
"NewLinesForBracesInMethods": false,
"NewLinesForBracesInProperties": false,
"NewLinesForBracesInAccessors": false,
@GavinRay97
GavinRay97 / settings.json5
Created March 9, 2021 18:11
VS Code official C/C++ Extension combined with clangd
// From: https://stackoverflow.com/a/59820115
{
"C_Cpp.intelliSenseEngine": "Disabled",
"C_Cpp.autocomplete": "Disabled", // So you don't get autocomplete from both extensions.
"C_Cpp.errorSquiggles": "Disabled", // So you don't get error squiggles from both extensions (clangd's seem to be more reliable anyway).
"clangd.path": "/path/to/your/clangd",
"clangd.arguments": ["-log=verbose", "-pretty", "--background-index", "--compile-commands-dir=/path/to/your/compile_commands_dir/"]
}
@GavinRay97
GavinRay97 / jsfx_dotprod.c
Created March 15, 2021 23:57 — forked from ess7/jsfx_dotprod.c
JSFX extension: dot product
// params: y0, y1, interleaved x, coeff, n
static EEL_F NSEEL_CGEN_CALL dotprod2(void *opaque, INT_PTR np, EEL_F **parms) {
EEL_F **blocks = (EEL_F **)opaque;
int xofs = *parms[2];
int cofs = *parms[3];
int n = *parms[4];
*parms[0] = 0.0;
*parms[1] = 0.0;
if (unlikely(n <= 0 || xofs < 0 || cofs < 0 ||
@GavinRay97
GavinRay97 / juce_audio_plugin_client_amalgamated.h
Created April 11, 2021 22:18
JUCE amalgamated audio plugin headers
This file has been truncated, but you can view the full file.
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
struct Assumer(T, alias assumeThis)
{
T store;
pragma(inline, true)
T get()
{
import gcc.builtins;
if(!assumeThis(store))
__builtin_unreachable();
return store;