A Guide to the Personal Web

Google is progressively getting worse, YouTube has more and more ADs, and most websites are very hard to use, as the screen is constantly filled with “cookie” pop-ups, ADs, videos and large paragraphs of keywords that contain nothing of real value. I’ve been bothered by the “modern” web quite a lot, as I used to get my news from YouTube, but seeing the internet get progressively worse made me wonder if there is a better way… ...

July 18, 2024 · 6 min · 1132 words · TrudeEH

Databases [SQL]

Flat-File Databases A “table” written into a single file. The most common file type for this purpose is CSV. The CSV format reads each line as a row, and each comma-separated value as a column. The first row on a CSV file is used to describe the data in each column. If a , is present on the dataset, surround that entry with " to ’escape’ it. These files can be read and written to using languages like c-language and python. ...

7 min · 1378 words · TrudeEH

Flask

Flask is a web framework for Python. It facilitates the creation of web apps (dynamic web pages). Run Flask Flask comes with its own server for debugging purposes, which can be started with: flask run Folder Structure app.py # main code requirements.txt # required libraries static/ # files that never change templates/ # dynamic files “Hello, name” — Example App templates/index.html <!DOCTYPE html> <html lang="en"> <head> <meta name = "viewport" content="initial-scale=1, width=device-width"> <title>Hello</title> </head> <body> hello, {{ name_placeholder }} <!-- Jinja template --> </body> </html> app.py http://website.domain/?name=Trude ...

4 min · 796 words · TrudeEH

HTML

HTML is a markup language: The foundation of every website, as it structures content and provides information such as text, images and other media to the browser. Hello World HTML is not a programming language, only formatting to write a document as. The following ‘code’ is valid HTML. Hello, world. A more complete solution, however, would be to define a structure for the document. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>Document</title> </head> <body> <p>Hello, world.</p> </body> </html> HTML uses tags to define a hierarchy. The <head> tag defines metadata for the site, such as the page’s title, encoding types, and any external resources. The <body> tag is the content itself: any paragraphs (<p>), images, forms and scripts, to name a few. ...

5 min · 1036 words · TrudeEH

HTTP [CURL]

HTTP HTTP (Hypertext Transfer Protocol) is a communication protocol used to send messages between the client and server, mainly used for the web. It’s stateless, meaning each request is independent, which is why web browsers often use cookies to save state. Request Structure Request Line: Method, URI, HTTP version (e.g., GET /index.html HTTP/1.1). Headers: Metadata about the request. Body (Optional): Data for POST, PUT, PATCH requests. Response Structure Status Line: HTTP version, status code, reason phrase (e.g., HTTP/1.1 200 OK). Headers: Metadata about the response. Body (Optional): Response data (HTML, JSON, etc.). Methods GET: Retrieve a resource. Should only retrieve data and not have side effects. POST: Submit data to be processed. PUT: Replace a resource. DELETE: Delete a resource. PATCH: Partially modify a resource. HEAD: Retrieve headers only. OPTIONS: Describe communication options. HTTP Headers HTTP headers are key-value pairs providing additional information about requests and responses. ...

3 min · 635 words · TrudeEH