Skip to content

Instantly share code, notes, and snippets.

View JSH32's full-sized avatar
📎
sudo rm -rf /

Josh Rudnik JSH32

📎
sudo rm -rf /
  • Deinde Financial LLC
  • Chicago, IL
View GitHub Profile
@JSH32
JSH32 / immich_backup.sh
Created April 7, 2024 20:08
Immich backup+db script designed to work with Backblaze B2 and rclone
#!/bin/bash
# Modify with the path to your Immich data/upload directory
IMMICH_DATA_DIR="/mnt/media/immich"
# Modify with the path to your local db backup directory
DB_BACKUP_DIR="/mnt/media/immich_db_backups"
# Your configured rclone path to B2 bucket
B2_BUCKET="backblaze:hydronbackup"
# Database container name
DB_CONTAINER_NAME="immich_postgres"
@JSH32
JSH32 / data.csv
Last active December 3, 2023 05:05
EKG R-Peak detection algorithm (Pan–Tompkins algorithm)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
hart
530
518
506
494
483
472
462
454
446
@JSH32
JSH32 / classdumper.java
Created August 2, 2023 18:26
Dump classes at runtime minecraft server
java
package com.yourplugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.*;
import java.nio.file.*;
import java.lang.instrument.*;
import java.security.ProtectionDomain;
@JSH32
JSH32 / media-stack.yml
Last active April 11, 2024 19:08
My media stack file for media server
version: "3.8"
services:
jellyfin:
image: jellyfin/jellyfin
volumes:
- jellyfin-config:/config
- jellyfin-cache:/cache
- ${MEDIA_LOCATION}:/media
# This is for menu links https://jellyfin.org/docs/general/clients/web-config/#custom-menu-links
package com.github.jsh32.paradoxia.commons
import net.minestom.server.MinecraftServer
import net.minestom.server.command.builder.Command
import net.minestom.server.event.EventNode
import org.koin.core.component.KoinComponent
import org.koin.core.context.loadKoinModules
import org.koin.core.context.unloadKoinModules
import org.koin.core.definition.Definition
import org.koin.core.module.Module
@JSH32
JSH32 / state.hpp
Last active June 30, 2022 04:27
Reactive State
#pragma once
template <class Container, class F>
auto erase_where(Container& c, F&& f) {
return c.erase(std::remove_if(c.begin(), c.end(), std::forward<F>(f)),
c.end());
}
/**
* @brief Reactive state. Listeners will be registered as callbacks to state
@JSH32
JSH32 / response.rs
Created March 6, 2022 01:28
A response type for actix. Allows you to use `?` for every error
use derive_more::Display;
use thiserror::Error;
use actix_web::{http::StatusCode, HttpRequest, HttpResponse, Responder, ResponseError};
#[derive(Debug, Display)]
pub struct Error(anyhow::Error);
/// # Response
///
/// Utility type for error reporting.
@JSH32
JSH32 / rust-semantic-colors.json
Created February 12, 2022 03:14
Rust semantic coloring
{
"[rust]": {
"editor.wordBasedSuggestions": false,
},
"editor.semanticTokenColorCustomizations": {
"[Default Dark+]": {
"enabled": true,
"rules": {
"method.static:rust": {
"foreground": "#f0c506"
@JSH32
JSH32 / DependencyNotFoundException.java
Created August 11, 2021 06:59
Basic dependency injection annotation framework with Java
public class DependencyNotFoundException extends Exception {
public DependencyNotFoundException(String message) {
super(message);
}
}
@JSH32
JSH32 / launch.json
Created July 7, 2021 09:34
VSCode settings for debugging Minecraft plugins
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch server",
"preLaunchTask": "runserver",
}
]
}