Skip to content

Instantly share code, notes, and snippets.

View prathje's full-sized avatar

Patrick Rathje prathje

  • Kiel University
  • Germany
View GitHub Profile
@prathje
prathje / ParentView.purs
Last active June 12, 2019 00:02 — forked from ibrahimsag/Raw.js
Raw Halogen HTML Component
module ParentView where
import Prelude
import Halogen as H
import Halogen.HTML as HH
import Halogen.HTML.Events as HE
import Halogen.HTML.Properties as HP
import Data.Maybe (Maybe(..))
import Control.Monad.Aff (Aff)
@prathje
prathje / sequence_overlay.py
Created January 14, 2021 19:55
Multiply base pdf files and merge them with a number overlay. Creates _base.pdf as an intermediate file and out.pdf as the final output. See: https://stackoverflow.com/a/47591251/6669161
from PyPDF2 import PdfFileWriter, PdfFileReader, PdfFileMerger
import io
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.pagesizes import A4
from reportlab.pdfbase.ttfonts import TTFont
import sys
if len(sys.argv) < 4:
@prathje
prathje / Dockerfile
Created January 27, 2021 19:43
BabbleSim with Zephyr Build Environment Dockerfile
FROM --platform=linux/amd64 zephyrprojectrtos/zephyr-build:latest as runtime
# Switch to root for installations
USER root
WORKDIR /bsim
ENV BSIM_OUT_PATH=/bsim/
ENV BSIM_COMPONENTS_PATH=/bsim/components/
@prathje
prathje / main.py
Created March 20, 2021 16:47
Extract Graylog Messages of a Stream for a Day Through API - Circumvents Elasticsearch Search Window Size By Splitting into multiple Timeranges
import urllib3
import sys
from datetime import datetime, timezone, timedelta, date
import requests
#urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Usage: python3 main.py http://example.org/api <token> <stream_id> 2020-01-01
@prathje
prathje / stalta.c
Last active September 6, 2024 22:35
3D STA LTA algorithm using moving window and circular buffer with delay option
/*
* 3D STA LTA algorithm using moving window and circular buffer
* 2024 Patrick Rathje
* CC BY-SA 4.0
*/
#include "stalta.h"
#include <string.h>
#include <math.h>
#include <float.h>