Skip to content

Instantly share code, notes, and snippets.

View nonchris's full-sized avatar
👀
Why isn't it moving?

Chris G nonchris

👀
Why isn't it moving?
View GitHub Profile
@nonchris
nonchris / logging_example.py
Created September 9, 2025 21:31
A (probably) pretty good baseline for setting up a python logger
"""
Sets up a logger for you python project.
Logs by to console and file, also hooks exceptions.
Logfile is by default: data/<logger_name>_<startup time>.log
If log-folder doesn't exist it will be created
Usage options:
from <this module> import logger
logger.info("hello there")

Ballon Jagd

Link zur Website:
https://arcade.makecode.com/

Ziel

Das Ziel ist es ein Spiel zu erstellen, in welchem du mit einem Flugzeug Luftballons jagst und diese zum Zerplatzen bringst.

Kurze Übersicht der Schritte

  • Hintergrund festlegen
  • Flugzeug erstellen
  • Flugzeug steuerbar machen
@nonchris
nonchris / AI-Workshop-Konzept.md
Last active August 8, 2025 20:04
Konzept für einen fünftägigen Workshop zum Thema AI-Tools (für Beginner)

Konzept für einen fünftägigen Workshop zum Thema AI-Tools

Der Workshop richtet sich an Beginner:innen und geht nicht auf technische Deails ein. Er fokussiert sich auf die Nutzung und das Verständnis von AI-Tools

  • Ausgearbeitet für ein Alter 10-13 Jahre.
  • Pro Tag ca. 3h Arbeitszeit
  • Der Workshop wurde als etwas zu schnell bewertet, was aber nicht zwingend am Stoff lag.

Meta:

Um schnell Logins, Aufgaben oder ähnliches gut lesbar an die Tafel zu werfen, kann eine online version von Screen Message genutzt werden. Eine Version davon ist z.B. sm.nomeata.de.

Eine Zusammenfassung der genutzten Tools plus kurze Anleitung wo notwendig befindet sich hier (für die Teilnehmer:innen als Zusammenfassung für Zuhause konzipiert)

@nonchris
nonchris / used-ai-tools.md
Last active August 8, 2025 20:00
The tools we used during our workshop

This is a summary on the tools we used during our workshop.
We're not providing any support beyond supplying this document.

You can find the latest version online in this gist.
(If you're already online, don't be confused, this is for offline copies).

Costs

The only thing that requires money are the tools relying on an API Key by OpenAI.
This is a model where you buy credits and then pay per usage.
The amounts are miniscule if you're kinda responsible.

@nonchris
nonchris / text-to-speech-gui-openai.py
Last active August 8, 2025 19:48
Simple Text to Speech GUI for OpenAI's API written in Python
"""
This is a very unclean, quick hack for educational purposes.
It allows you to interact with open ai's TTS (text to speech) backend via the API.
You can choose between all their voices.
Note: This code has a few known bugs/ issues:
* It uses a deprecated function for writing the audio
* The filename field for the user is just ignored.
* The API key is HARDCODED in the software and can be extracted easily
* You can't paste using right click (ctrl+v works though)
@nonchris
nonchris / format_execption.py
Created November 4, 2023 22:32
might be helpful for someone
# might be useful for someone - but traceback.format_exc() is honestly better
# but this version gives at least some understanding of whats happening
def exec_location_info():
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback_details = tb.extract_tb(exc_traceback, limit=None)
last_call = traceback_details[-1]
rel_path = os.path.relpath(last_call.filename)
@nonchris
nonchris / enter_shikari_wallpaper.py
Last active March 27, 2024 04:26
a customizable script to create the logo of 'enter: shikari' as wallpaper using matplotlib (and python)
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
file_name = "wallpaper" # base name of the file
dpi = 650 # resolution
edge_color = "#FF0050" # color of the logo
scale_factor = 1.55 # how large shall it be?
landscape = True # landscape or portrait mode?
@nonchris
nonchris / things_i_did.py
Last active August 18, 2023 11:43
things i did
"""
Things I did and always look up how I did it.
Feel free to suggest futher things you always forget :)
"""
# date format
f'{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}'
# current directory
f"{os.getcwd()}/{file_name}"
@nonchris
nonchris / minecraft-python-installation.md
Last active October 18, 2024 16:10
Installationsanweisungen für den "python mit minecraft" Workshop

Python programmieren mit Minecraft:

Anleitung siehe https://jandahlhaus.de/python-programmieren-mit-minecraft/
Falls das installierte Java zu neu ist und nicht unterstützt wird, bitte JDK11 von hier installieren:
https://adoptium.net/de/temurin/archive

Angepasst von Christoph Geron, Jun 2022 (getestet in 2024) Änderungen:

  • Anweisungen für Pycharm (Community Edition) install hinzugefügt
  • Installation der python pakete in venv
  • Jupyter erfordert und Anleitung zum Install und Test hinzugefügt
@nonchris
nonchris / telegram-inline-bot.py
Created June 9, 2022 23:21
A very simple inline telegram bot as starting point (it tells you the time if you ask)
# pip3 install python-telegram-bot~=13.12
import datetime as dt
import os
from telegram import Bot, Update, CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import Updater, CallbackQueryHandler, CallbackContext, MessageHandler, Filters
# inline keyboard sent with messages
main_menu = InlineKeyboardMarkup([[InlineKeyboardButton('time', callback_data='time'),