Skip to content

Instantly share code, notes, and snippets.

@EssGeeEich
EssGeeEich / CalcMatrix.cpp
Created May 1, 2025 21:35
Get interpolated value from 2D matrix
// Mauro Grassia (c) 2022
// The Unlicense
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
@EssGeeEich
EssGeeEich / Self-Host-Autodelete-Bot.md
Last active August 26, 2023 17:45
Self Hosting the Autodelete Bot

If you run a Debian server and don't want to/can't setup Docker but want to run the AutoDelete bot, you can follow the instructions below that I just composed.

Save the following script to a new file on your server and run it (with sudo or root):

#!/bin/bash

# Change this if you want to install the bot in a different folder
INSTALL_DIR=/srv/autodelete
@EssGeeEich
EssGeeEich / QImageWidget.cpp
Last active October 11, 2022 22:07
A simple and fast QWidget that simply displays an image, scaling it down and keeping its aspect ratio, eventually aligning it to a preferred corner.
#include "qimagewidget.h"
#include <QPainter>
QImageWidget::QImageWidget(QWidget *parent, Qt::Alignment alignment)
: QWidget{parent},
m_alignment(alignment)
{}
QImage QImageWidget::image() const { return m_image; }
QPixmap QImageWidget::pixmap() const { return m_pixmap; }
@EssGeeEich
EssGeeEich / BitwardenRS
Last active July 2, 2020 16:31
An easy and SELinux compliant pod builder.
ModuleVolumes $ModDir:/data/
ModuleROVolumes
ModuleEnvironments DATABASE_URL=mysql://bitwarden:random_password_here@127.0.0.1/bitwarden ENABLE_DB_WAL=false
ModuleImage bitwardenrs/server-mysql:latest
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Melissa E. O'Neill
*