Skip to content

Instantly share code, notes, and snippets.

@rena2019
rena2019 / main.dart
Last active July 10, 2025 08:41
Flutter center graphic with label left and right (with table)
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@rena2019
rena2019 / center_button_with_labels.dart
Created July 9, 2025 13:34
Flutter center button with label to left and right 2
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@rena2019
rena2019 / main.dart
Last active July 10, 2025 05:45
Flutter center button with label to left and right (with Stack)
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@rena2019
rena2019 / mygridview.dart
Last active July 7, 2025 16:55
GridView mit Mindestbreite
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'GridView mit Mindestbreite',
home: Scaffold(
@rena2019
rena2019 / alertdialog.dart
Created July 3, 2025 07:02
AlertDialog with Pop-up dialog
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@rena2019
rena2019 / eml2png.py
Created May 5, 2025 12:26
Extract PNGs from EML
import os
from email import policy
from email.parser import BytesParser
# Pfad zur .eml-Datei
eml_file = "beispiel.eml"
output_dir = "bilder"
# Sicherstellen, dass der Ausgabeordner existiert
os.makedirs(output_dir, exist_ok=True)
@rena2019
rena2019 / nimble_charts_line_chart_animation_zoom.dart
Created April 24, 2025 11:36
example LineAnimationZoomChart (LineChart + animate + pan/zoom)
//taken from https://github.com/Nimblesite/nimble_charts/blob/main/charts_flutter/example/lib/line_chart/animation_zoom.dart
import 'package:flutter/material.dart';
import 'dart:math';
//install with flutter pub add nimble_charts
import 'package:nimble_charts/flutter.dart' as charts;
void main() {
runApp(const MyApp());
}
@rena2019
rena2019 / nimble_charts_example.dart
Last active April 24, 2025 09:43
nimble_charts example
// taken from https://github.com/Nimblesite/nimble_charts/blob/main/charts_flutter/example/lib/line_chart/simple.dart
import 'package:flutter/material.dart';
import 'dart:math';
//install with flutter pub add nimble_charts
import 'package:nimble_charts/flutter.dart' as charts;
void main() {
runApp(const MyApp());
}
@rena2019
rena2019 / main.dart
Last active April 4, 2025 09:14
myconstructors.dart
class PointA {
double x = 1.0;
double y = 2.0;
// The implicit default constructor sets these variables to (1.0,2.0)
// PointA();
//
PointA(String s) : x = double.parse(s), y = double.parse(s);
@rena2019
rena2019 / serial_port_via_ssh.txt
Last active November 7, 2024 23:24
serial port via SSH
#1. ESP32 @ /dev/ttyS7 <-> /dev/ttyV1
# baudrate auf 115200 setzen (ist erforderlich)!
stty -F /dev/ttyS7
# virtuellen port /tmp/ttyV1 erstellen und mit /dev/ttyS7 verbinden mit -x => verbose hexadecimal dump of data traffic
socat -x PTY,link=/tmp/ttyV1,raw,echo=0,crnl /dev/ttyS7,b115200,raw,echo=0
#per tio output anschauen
tio /tmp/ttyV1
#2. dasselbe mit Umweg über IP/Port: /dev/ttyS7 <-> localhost:54321 <-> /tmp/ttyV1
socat -dd /dev/ttyS7,b115200,raw,echo=0 tcp-listen:54321