Skip to content

Instantly share code, notes, and snippets.

View bbenno's full-sized avatar
🍁
How we perceive a problem can change every time we see it.

Benno Bielmeier bbenno

🍁
How we perceive a problem can change every time we see it.
  • OTH Regensburg
  • Bavaria
View GitHub Profile
@bbenno
bbenno / tipp10_prepare.sed
Last active January 9, 2020 20:17
Convert text from Wikipedia to easy readable, easy processable text
# citation marks
s/\[[[:digit:]]\+\]//g
s/\[citation needed\]//g
# print non-ASCII
#s/[^[:print:\n\r\t]]+/sign: &/w errorfile
# empty lines
/^[[:space:]]*$/d
@bbenno
bbenno / dark-mode-toggle.js
Last active July 6, 2020 08:14 — forked from pbaity/dark-mode-toggle.js
Rocket.Chat Dark Mode
// Toggleable dark mode for those of us that care about that kind of thing.
const darkModeSymbol = `<svg id="icon-darkmode" viewBox="0 0 468 468" fill="currentColor">
<path d="m428.75601,300.104c-0.664,-3.81 -2.33401,-7.047 -4.996,-9.71301c-5.89999,-5.90298 -12.75201,-7.142 -20.55399,-3.716c-20.93701,9.70801 -42.64102,14.55801 -65.09702,14.55801c-28.17099,0 -54.15201,-6.94 -77.94299,-20.83801c-23.791,-13.89398 -42.63101,-32.73599 -56.52501,-56.52998c-13.899,-23.793 -20.84399,-49.77299 -20.84399,-77.94499c0,-21.88802 4.33299,-42.68301 12.991,-62.384c8.66,-19.7 21.17599,-36.973 37.543,-51.82c6.283,-5.898 7.713,-12.752 4.287,-20.557c-3.23601,-7.801 -9.041,-11.511 -17.41501,-11.132c-29.12099,1.141 -56.71999,7.664 -82.797,19.556c-26.076,11.89499 -48.48901,27.54699 -67.23801,46.96499c-18.747,19.414 -33.595,42.39899 -44.54,68.94999c-10.942,26.55301 -16.416,54.39 -16.416,83.51102c0,29.694 5.806,58.05399 17.416,85.082c11.613,27.02798 27.218,50.34399 46.824,69.94897c19.604,19.599 42.92,35.207 69.951,46.82202c27.028,1
@bbenno
bbenno / listings-glsl.prf
Last active November 6, 2023 12:12
LaTex Listings: GLSL Language
%% Copyright (c) 2020-2021 Benno Bielmeier
%% SPDX-License-Identifier: MIT
%%
%% GLSL definition
%%
\lstdefinelanguage{GLSL}%
{%
morekeywords={%
% HLSL constants
false,FALSE,NULL,true,TRUE,%
@bbenno
bbenno / cheatsheet-latex.md
Last active August 20, 2020 12:00
Cheatsheet LaTeX

LaTeX Cheatsheet

Abbreviation Definition
pt A point, is the default length unit. About 0.3515mm
mm a millimetre
cm a centimetre
in an inch
ex the height of an x in the current font
em the width of an m in the current font
@bbenno
bbenno / Makefile
Created August 26, 2020 13:01
Makefile for IAR Embedded Workbench Projects using `iarbuild`
PROJ_NAME=<...>
PROJ_FILE=$(PROJ_NAME).ewp
IAR_FLAGS = -log info
IAR_FLAGS += -parallel 4
CONFIG=*
# Brings the current build configuration up to date by compiling, assembling,
# and linking only the files that have changed since the last build.
#!/usr/bin/python
"""linear_program.py: Solves an simple integer linear program.
Maximize
f(x) = 6x₁ + 4x₂
with
x₁, x₂ ∈ ℕ
@bbenno
bbenno / commands.tex
Last active November 16, 2020 15:31
DQCO LaTeX commands
% Import essential packages
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
% Define common constructs
\newcommand{\cat}[1]{|#1\rangle}
\newcommand{\bra}[1]{\langle#1|}
\newcommand{\bracat}[2]{\langle#1|#2\rangle}
\newcommand{\sqav}[1]{\big|#1\big|^2} % square of the absolute value
@bbenno
bbenno / ADR_template.adoc
Created January 31, 2021 18:12
Architecture Decision Record

Problem Title: Decision

Note
Status

[ pending | decided | approved | deprecated | superseeded | …​ ]

Decision by

Responsible Person

Date

2020-06-27

@bbenno
bbenno / pdf2txt.rb
Last active February 4, 2021 13:04 — forked from emad-elsaid/pdf2txt.rb
PDF to Text converter using ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'pdf/reader'
# credits to :
# https://github.com/yob/pdf-reader/blob/master/examples/text.rb
# usage example:
# ruby pdf2txt.rb /path-to-file/file1.pdf [/path-to-file/file2.pdf..]
ARGV.each do |filename|
@bbenno
bbenno / plot_base_json.R
Created April 29, 2021 18:03
base.json Visualisation
library(tidyverse)
library(jsonlite)
library(here)
save_plot <- function(...) ggsave(width = 7, height = 5, ...)
data <- here("base.json") %>%
fromJSON() %>%
`[[`("thread") %>%
map2(names(.), function(thread, thr_name) {