Skip to content

Instantly share code, notes, and snippets.

View andre-hartmann's full-sized avatar

André Hartmann andre-hartmann

View GitHub Profile
# $HOME/.local/lib/python3.10/site-packages/engineer.py
# Usage: `python3 -i -c "from engineer import *"`
# >>> eng(1/48e6)
# '20.833E-9'
# Stellt die zahl im Ingenieursformat 123E-6 oder 234E3 dar
def eng(zahl):
# Sonderfall: Zahl ist 0
if zahl == 0:
return "0.0"
minimum_size 300
background yes
use_xft yes
xftfont Bitstream Vera Sans Mono:size=9
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
-test Core,test_basefilefilter
-test QtSupport,testQtOutputFormatter
-test QtSupport
-test CppTools
BUILD_TESTS=1; Then add run configuration tst_lexer
PATH=~/bin:${PATH}
md() { mkdir $1 && cd $1; }
cd() { builtin cd $1 && ls; }
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias gh='cd ~'
@andre-hartmann
andre-hartmann / main.cpp
Last active August 1, 2024 07:10
QCommandLineParser with subcommands
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QTextStream>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCommandLineParser parser;
parser.setOptionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsOptions);
parser.addPositionalArgument("subcommand",
#include <QCanBus>
#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
const QStringList plugins = QCanBus::instance()->plugins();
for (auto plugin : plugins) {
QString errorString;
@andre-hartmann
andre-hartmann / test-canbusutil.sh
Created November 26, 2017 16:50
canbusutil test script
#!/bin/bash
util=~/git/qt5/qtbase/bin/canbusutil
function print()
{
echo
echo $*
}