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 / autorefresh.sh
Created March 4, 2019 13:52
Autorefresh and Compile LaTeX
mupdf Prüfung.pdf &
ls Prüfung.tex | entr /bin/sh -c "pdflatex Prüfung.tex && pkill -HUP mupdf"
public void berechneRestZeitVonSchicht(int std, int min) {
int schicht = std / 8 + 1;
int volleMinuten = std * 60 + min;
int minutenEnde = schicht * 8 * 60;
int minutenBisEnde = minutenEnde - volleMinuten;
int stundenBisEnde = minutenBisEnde / 60;
@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==
@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 / 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 / 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 / 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 / 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
\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 / 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}