Skip to content

Instantly share code, notes, and snippets.

View joshdevous's full-sized avatar

joshua joshdevous

  • England, United Kingdom
  • 18:29 (UTC +01:00)
View GitHub Profile
@joshdevous
joshdevous / database-schema.md
Created April 21, 2026 13:23
Treetag Database Schema

Treetag Database Schema

Overview

  • Engine: MongoDB (database name treetag)
  • ODM: Mongoose (schemas defined in src/lib/server/db/models/)
  • Connection: src/lib/server/db/index.ts (connectDB() using DATABASE_URL from env)
  • Auth store: better-auth with mongodbAdapter, sharing the same Mongo database (src/lib/server/auth.ts). Better-auth manages its own collections (user, session, account, verification).
  • Conventions:
  • timestamps: true on every app collection (createdAt, updatedAt)
{"name":"Josh","settings":"{\"settings\":\"{\\r\\n \\\"window.commandCenter\\\": true,\\r\\n \\\"editor.largeFileOptimizations\\\": false,\\r\\n \\\"git.enableSmartCommit\\\": true,\\r\\n \\\"explorer.confirmDelete\\\": false,\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"svelte.enable-ts-plugin\\\": true,\\r\\n \\\"claudeCode.preferredLocation\\\": \\\"panel\\\",\\r\\n \\\"claudeCode.selectedModel\\\": \\\"sonnet\\\",\\r\\n \\\"workbench.colorTheme\\\": \\\"GitHub Dark Default\\\"\\r\\n}\"}","keybindings":"{\"keybindings\":\"// Place your key bindings in this file to override the defaults\\n[\\n {\\n \\\"key\\\": \\\"ctrl+i\\\",\\n \\\"command\\\": \\\"composerMode.agent\\\"\\n },\\n {\\n \\\"key\\\": \\\"ctrl+i\\\",\\n \\\"command\\\": \\\"composerMode.agent\\\"\\n },\\n {\\n \\\"key\\\": \\\"ctrl+i\\\",\\n \\\"command\\\": \\\"composerMode.agent\\\"\\n },\\n {\\n \\\"key\\\": \\\"ctrl+shift+'\\\",\\n \\\"
@joshdevous
joshdevous / convert-and-compress.ps1
Created December 16, 2025 21:41
Batch converts MKV files to H.265 MP4, moves originals to a separate folder, and shows before/after storage stats
param(
[string]$Directory = ".",
[int]$CRF = 22,
[string]$Preset = "medium"
)
$targetDir = Resolve-Path $Directory
$originalsDir = Join-Path $targetDir "Originals"
# Create Originals folder if it doesn't exist
@joshdevous
joshdevous / Searcher.java
Last active December 16, 2022 23:50
A searching algorithm to find the best lectures from a query string.
package gg.joshbaker.searcher;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.commons.text.similarity.JaroWinklerDistance;
import java.io.IOException;
import java.nio.file.Files;
@joshdevous
joshdevous / Command.java
Last active January 10, 2022 00:17
JDA Command Framework (Slash Commands)
package com.learnspigot.bot.framework.command;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Command {