Skip to content

Instantly share code, notes, and snippets.

View MartinThoma's full-sized avatar

Martin Thoma MartinThoma

View GitHub Profile
@MartinThoma
MartinThoma / trump-relativity.md
Created October 19, 2023 20:21
Show how ChatGPT can mimik people
View trump-relativity.md

Explain general relativity in the style of Donald Trump

ChatGPT:

Let me tell you, folks, General Relativity, it's a big, big theory, okay? So, you've got this guy, Albert Einstein, right? He was a smart guy, but I'm a smart guy too, very smart, very stable genius. So Einstein, he comes up with this idea, General Relativity. And it's all about gravity, you know, the thing that keeps us on the ground.

View fillform.py
from pypdf import PdfReader, PdfWriter
import pypdf
import sys
print(f"Python {sys.version} using pypdf=={pypdf.__version__}")
reader = PdfReader("Antrag.pdf") # https://www.docdroid.net/HvUlMpM/antrag-pdf
# Get the field names
# fields = reader.get_fields()
@MartinThoma
MartinThoma / [WP] "Cheating a goddess" with Chat GPT Plus (GPT-4)
Last active April 2, 2023 06:25
[WP] You stood there, looking at your friend, faceplaming "Let me get this straight, you're dating a Goddess, an actual 'divine powers, older than civilization' Goddess and you ....CHEATED ON HER!?!??" Your friend has a desperate look in their eyes "Can you help me or not?"
View [WP] "Cheating a goddess" with Chat GPT Plus (GPT-4)
As I stood there in disbelief, I couldn't help but feel a mix of amusement and
concern. My friend, Josh, had managed to get himself into the most absurdly
dangerous and comical situation imaginable. He had somehow managed to win the
heart of Lilaia, the enchanting Goddess of Balance and Harmony. Her powers were
legendary, with the ability to restore equilibrium to any situation, whether it
was calming the fiercest storms or soothing the angriest of hearts. Legend had
it that she had once single-handedly quelled a war between two ancient
civilizations, restoring peace and ushering in a golden age of prosperity. And
now, Josh had cheated on her with a mortal woman.
View post-request.yaml
/store/order:
post:
summary: Place an order for a pet
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
View colors.py
def get_color(i: int) -> Tuple[int, int, int, int]:
r = i % 256
g = 0 # i * 2 % 256
b = i % (256*2)
return (r, g, b, 255)
View algorithmic_art.py
from dataclasses import dataclass
from typing import List, Tuple
# Just store https://stackoverflow.com/a/5709655/562769
# as anti_aliased_line.py in the same directory
from anti_aliased_line import draw_line_antialiased
from PIL import Image, ImageDraw
@dataclass
View move-point-on-line.py
from dataclasses import dataclass
@dataclass
class Point:
x: float
y: float
@dataclass
class Line:
View pillow-draw-line.py
from PIL import Image, ImageDraw # pip install pillow for PIL
# Define the canvas size
width = 1500
height = 500
im = Image.new("RGB", (width, height), (255, 255, 255))
draw = ImageDraw.Draw(im)
# Draw a single line
x1, y1 = 10, 20
View remove-files.txt
.github/workflows/build.yml
00_Alternate_Languages/41_Guess/rust/Cargo.toml
00_Alternate_Languages/48_High_IQ/d/highiq.d
00_Alternate_Languages/57_Literature_Quiz/javascript/literature-quiz-node.mjs
00_Alternate_Languages/59_Lunar_LEM_Rocket/rust/rocket/Cargo.toml
00_Alternate_Languages/60_Mastermind/rust/Cargo.toml
00_Alternate_Languages/65_Nim/rust/Cargo.toml
00_Alternate_Languages/66_Number/rust/Cargo.toml
00_Alternate_Languages/72_Queen/python/.flake8
00_Alternate_Languages/74_Rock_Scissors_Paper/rust/Cargo.toml
View textual-example.py
from rich.panel import Panel
from textual.app import App
from textual.reactive import Reactive
from textual.widget import Widget
class Hover(Widget):
mouse_over = Reactive(False)