Skip to content

Instantly share code, notes, and snippets.

View r0oland's full-sized avatar
🎯
Focusing

Johannes Rebling r0oland

🎯
Focusing
View GitHub Profile
@r0oland
r0oland / regex_replace_c_comments.txt
Last active April 9, 2024 12:55
Regex | Search and Replace
serach: /\*(.*?)\*/
replace: //$1
@r0oland
r0oland / vlc_xbar.c
Last active April 9, 2024 11:58
NXP iMX XBAR PWM AOI Notes
//------------------------------------------------------------------------------
void vlc_xbar_init(void) {
// Initialise multiplexer
XBARA_Init(XBARA1);
XBARB_Init(XBARB2);
// disable faults for cam1 and cam2 PWM systems so they can be enabled
XBARA_connect(XBAR_ENABLE, kXBARA1_OutputFlexpwm1Fault0);
@r0oland
r0oland / header_template.h
Last active April 16, 2024 12:34
C Templates and Usefull Stuff
/**
* @author Johannes Rebling (johannes.rebling@asmpt.com)
* @brief
* @date
*
* @copyright ASMPT GmbH & Co. KG, SMT R&D 34 - 2024
*
*/
#ifndef _XXX_H
@r0oland
r0oland / first_cell.py
Created October 30, 2023 07:52
Auto Reload Python Files in Jupyter
%reload_ext autoreload
%autoreload 2
@r0oland
r0oland / readme.md
Created September 30, 2023 06:36
Winget Packages

export using: winget export -o .\winget-export.json

import using: winget import -i .\winget-export.json --accept-package-agreements

@r0oland
r0oland / subplots.py
Last active March 22, 2024 10:25
Python Plotting
# see https://matplotlib.org/stable/gallery/subplots_axes_and_figures/mosaic.html#sphx-glr-gallery-subplots-axes-and-figures-mosaic-py
DPI = 100
Y_HEIGHT = 800
X_WIDTH = 1000
fig = plt.figure(figsize=(X_WIDTH/DPI, Y_HEIGHT/DPI), dpi=DPI)
axDict = fig.subplot_mosaic(
[
["a", "b"],
@r0oland
r0oland / conda.ps1
Last active March 24, 2024 12:21
Useful Python snippets
# create new empty env
conda create --name myenv
# export currently activated env to environment.yml without prefixes etc
conda env export --from-history | findstr -v "prefix" > environment.yml
# install environment based on such a environment.yml
conda env create -f environment.yml
# or even better, using Mamba
@r0oland
r0oland / powershell.ps1
Created October 7, 2022 17:26
Practical ANSI Color Codes
# simple effects
$BOLD = "`e[1m"
$UNDERLINED = "`e[4m"
# simple colors
$RED = "`e[31m"
$GREEN = "`e[32m"
# RGB colors
$METER_BLUE = "`e[38;2;34;98;147m" # 0x22 0x62 0x93 == 34 98 147
@r0oland
r0oland / .clang-format
Last active July 19, 2022 07:26
Default Python Packages...
---
BasedOnStyle: LLVM
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'true'
AlignOperands: 'false'
AllowAllArgumentsOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
DerivePointerAlignment: 'false'