Skip to content

Instantly share code, notes, and snippets.

View malte-j's full-sized avatar
❤️
🍍🍕

Malte Janßen malte-j

❤️
🍍🍕
View GitHub Profile
@malte-j
malte-j / ts.dart
Created December 4, 2023 10:35
dart thompson sampling
import 'dart:math';
class ThompsonSampling {
final List<double> means;
final List<double> variances;
ThompsonSampling(List<double> initialMeans, List<double> initialVariances)
: means = List.from(initialMeans),
variances = List.from(initialVariances);
@malte-j
malte-j / hpi_moodle_autologin.js
Created April 26, 2023 10:16
Automatically clicks the SSO login button in moodle.
// ==UserScript==
// @name HPI Moodle Autologin
// @namespace https://malts.me/
// @version 1.0
// @description Automatically clicks the SSO login button in moodle.
// @author Malte Janßen (hi@malts.me)
// @match https://moodle.hpi.de/login/index.php
// @icon https://moodle.hpi.de/theme/image.php/boost/theme/1678719034/favicon
// @grant none
// ==/UserScript==
@malte-j
malte-j / eidesstattliche_erklärung.tex
Created September 4, 2022 11:33
Latex Cide für die Eidesstattliche Erklärung
\clearpage
{
\centering
\section*{Eidesstattliche Erklärung}
}
Hiermit erkläre ich, dass ich die vorliegende Arbeit eigenständig und ohne fremde Hilfe angefertigt habe. Textpassagen, die wörtlich oder dem Sinn nach auf Publikationen oder Vorträgen anderer Autoren beruhen, sind als solche kenntlich gemacht. Die Arbeit wurde bisher keiner anderen Prüfungsbehörde vorgelegt und auch noch nicht veröffentlicht.
\vspace{2cm}
\usepackage{listings}
\lstset{
captionpos=b,
frame=single
}
\lstdefinelanguage{Typescript}{
keywords={break, case, catch, continue, debugger, default, delete, do, else, finally, for, function, if, in, instanceof, new, return, switch, this, throw, try, typeof, var, void, while, number, with, string, any },
morecomment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]',
@malte-j
malte-j / movToMp4.sh
Created June 16, 2022 15:36
davinci resolve mov to mp4
ffmpeg -i input.mov -vf yadif -codec:v libx264 -crf 1 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart output.mp4
@malte-j
malte-j / prisma.Dockerfile
Created January 22, 2022 19:58
Dockefile with Prisma and OpenAPI support
FROM node:16-alpine as builder
WORKDIR /app
ENV NODE_ENV=production
# Install shared dependencies
COPY tsconfig.json tsconfig.build.json package.json package-lock.json lerna.json ./
RUN npm set-script prepare ""
RUN npm ci
# Install project dependencies
@malte-j
malte-j / docker-compose.yml
Created November 4, 2021 20:49
mongo docker compose file
version: '3.1'
services:
db:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: mongousr
MONGO_INITDB_ROOT_PASSWORD: mongorootpwd
#volumes:
# - mongodata:/data/db
ports:
@malte-j
malte-j / custom-error-js
Created April 19, 2021 12:20
JS Custom Error with error code
class ApplicationError extends Error {
constructor(errorCode, ...params) {
// Pass remaining arguments (including vendor specific ones) to parent constructor
super(...params);
// Maintains proper stack trace for where our error was thrown (only available on V8)
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ApplicationError)
}
@malte-j
malte-j / wp-cli-shared.md
Last active August 15, 2020 18:04
Installing WP-CLI on shared hosting

Install wp-cli:

mkdir wp-cli && cd wp-cli && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Add wp-cli to path, making it executable globally

echo "alias wp=\"~/wp-cli/wp-cli.phar --path='/usr/home/chaos/public_html'\"" >> ~/.bashrc

Test if it's working:

@malte-j
malte-j / lmsNoForcedownload.js
Last active November 25, 2019 10:10
LMS ohne Downloadzwang von Anhängen
// ==UserScript==
// @name LMS Kein Downloadzwang
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Verhindert Downloadzwang von verlinkten Dokumenten
// @author Malte Janßen
// @match https://lms.beuth-hochschule.de/mod/assign/*
// @grant none
// ==/UserScript==