This commit is contained in:
2025-11-30 19:50:46 +01:00
parent b40ccbb983
commit 9ccb7736db
19 changed files with 8450 additions and 0 deletions

15
astro.config.mjs Normal file
View File

@@ -0,0 +1,15 @@
// @ts-check
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
// https://astro.build/config
export default defineConfig({
integrations: [tailwind()],
site: "https://vxheaven.cc",
markdown: {
shikiConfig: {
theme: "kanagawa-dragon",
},
},
});

1003
bun.lock Normal file

File diff suppressed because it is too large Load Diff

6913
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
package.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "minimal",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/rss": "^4.0.11",
"@astrojs/tailwind": "^6.0.2",
"@tailwindcss/postcss": "^4.1.4",
"astro": "^5.1.2"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.15"
}
}

BIN
public/favicon.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
public/fonts/gohu.woff2 Normal file

Binary file not shown.

BIN
public/fonts/unifont.woff2 Normal file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
---
---
<pre
class="flex justify-center text-center pt-48 leading-none overflow-hidden text-nowrap">
▄██▄ ▄██▀ ▄█████▄ ▄████▄ ██▄ ▄██ ▄█████▄ ███▄ ▄██▀
▌▐██ ██▌ ▄██ ▓█▌▐▀ ▀█▄ ▀██ ██▀ ▄██ ▓█▌▐██▀██ ██▐
██▄▄██ ▐██▀████▀ ▄███▄█▓ ▀██ █▓▀ ▐██▀████▀ ██ ██ █▓
███▀██ ▐██ ▄▓▌▐█▌ ▓▒ ▀▓▒▒▀ ▐██ ▄▓▌ ██ ██ ▓▒
▐█▓ █▓▌ ▀██▄▄▓▒▀ ▐██▄▄▓▒░▄ ▀░▀ ▀██▄▄▓▒▀ ▄██ ▓▓▄▒░
▓▒░ ▓▒░ ▐▀▀▀ ▐▀▀ ▀▀▌ ▐ ▐▀▀▀ ▄███ ▒▒▒░▌
▐░▀ ▐▀ ▐▀▀ ▀░░▌
▌ ▐
</pre>
<!-- <p class="text-center pb-12">ᶻ 𝗓 𐰁</p> -->

View File

@@ -0,0 +1,11 @@
---
---
<div class="flex flex-col max-w-auto m-auto items-center">
<ul class="grid md:grid-cols-4 sm:flex gap-x-4">
<li><span class="select-none">♱ </span><a tabindex="0" href="/archive" class="text-c_mauve decoration-dotted hover:underline hover:cursor-pointer overflow-hidden text-nowrap">Archive</a></li>
<li><span class="select-none">𖹭 </span><a tabindex="0" href="/rss.xml" class="text-c_mauve decoration-dotted hover:underline hover:cursor-pointer overflow-hidden text-nowrap">Propaganda (RSS)</a></li>
<li><span class="select-none">&#123&#125 </span><a tabindex="0" href="https://github.com/" target="_blank" class="text-c_mauve decoration-dotted hover:underline hover:cursor-pointer overflow-hidden text-nowrap">Projects</a></li>
</ul>
</div>

28
src/layouts/Layout.astro Normal file
View File

@@ -0,0 +1,28 @@
---
import '../styles/global.css'
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.webp" />
<meta name="generator" content={Astro.generator} />
<title>૮₍ • ᴥ • ₎ა</title>
</head>
<body class="font-unifont px-4 m-auto md:m-0 bg-c_crust text-c_text">
<slot />
</body>
</html>
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
font-family: inherit;
}
</style>

View File

@@ -0,0 +1,102 @@
---
// pages/whatever.astro
import Layout from "../layouts/Layout.astro";
import GlobalLogo from "../components/GlobalLogo.astro";
const { frontmatter } = Astro.props;
---
<Layout>
<GlobalLogo />
<div class="mb-32">
<div
class="p-4 flex flex-col m-auto max-w-[700px] font-gohu leading-none
prose-p:mb-4 prose-headings:my-1 prose-headings:text-xl prose-headings:font-bold prose-headings:text-c_mauve prose-ol:list-decimal prose-ol:list-inside
prose-ol:mb-4 prose-ul:ml-4 prose-ul:list-disc prose-ul:mb-4 prose-ul:flex-col prose-hr:mt-8 prose-hr:mb-6 prose-hr:border-c_surface0
prose-a:text-c_mauve prose-a:decoration-dotted hover:prose-a:underline prose-pre:my-4 prose-pre:py-4 prose-pre:px-4
marker:text-c_mauve prose-code:font-gohu prose-img:my-4 prose-img:w-screen"
>
<a
tabindex="0"
href="../../"
class="flex w-max text-c_mauve decoration-dotted hover:underline hover:cursor-pointer mb-4"
>« Back<br /><br /></a
>
<h1 class="font-bold text-xl">
{frontmatter.title}
</h1>
<article class="">
<slot />
</article>
<p>~{frontmatter.author}</p>
</div>
</div>
</Layout>
<style is:global>
/* =========================
Strong overrides for Tailwind Typography / Shiki / Astro codeblocks
========================= */
/* Target the usual suspects:
- Tailwind Typography uses .prose pre
- Shiki / Astro often emit pre.ast-code or pre[class*="language-"]
We make these global and high-specificity so they win.
*/
html .prose pre,
html .prose pre code,
pre[class*="language-"],
code[class*="language-"],
pre.ast-code,
.astro-code,
.shiki pre,
pre {
/* allow wrapping of long lines */
white-space: pre-wrap !important; /* allow wrapping while preserving whitespace */
word-break: break-word !important; /* break long words/identifiers if needed */
overflow-wrap: anywhere !important; /* extra aggressive wrap */
max-width: 100% !important; /* don't overflow container */
box-sizing: border-box !important;
}
/* Keep block semantics for code content */
html .prose pre code,
pre[class*="language-"] > code {
display: block !important;
}
/* Keep a horizontal fallback for extremely long uninterrupted strings
(URLs/base64/etc.), but wrapping will be used in most cases. */
html .prose pre {
overflow-x: auto !important;
-webkit-overflow-scrolling: touch;
}
/* Optional: nicer padding and visual treatment */
html .prose pre {
padding: 1rem !important;
border-radius: 0.5rem !important;
background-color: rgba(
0,
0,
0,
0.03
) !important; /* tweak to taste or remove */
}
/* Inline code (inside paragraphs) — keep the normal inline look, don't force wrap */
html .prose code:not(pre code) {
white-space: normal !important;
overflow: visible !important;
word-break: normal !important;
}
/* If you're using tailwind's 'prose-sm' / modifiers or custom wrappers, increase specificity */
html body .prose pre,
html body .prose pre code {
/* repeat important rules to be extra sure */
white-space: pre-wrap !important;
word-break: break-word !important;
overflow-wrap: anywhere !important;
}
</style>

44
src/pages/archive.astro Normal file
View File

@@ -0,0 +1,44 @@
---
import Layout from '../layouts/Layout.astro';
import GlobalLogo from "../components/GlobalLogo.astro";
const allPosts = Object.values(import.meta.glob('./posts/*.md', { eager: true }))
.sort((a: any, b: any) => {
const dateA = new Date(a.frontmatter.pubDate);
const dateB = new Date(b.frontmatter.pubDate);
return dateB - dateA; // Sort descending (newest first)
});
---
<Layout>
<div class="text-center">
<GlobalLogo/>
<div class="flex flex-col max-w-[32rem] m-auto items-center border-4 border-double p-2 mb-12 border-c_text">
<h5 class="flex justify-between">Archive:</h5>
<ul class="w-full">
{allPosts.map((post: any) =>
<li class="flex w-full items-center text-nowrap">
<a tabindex="0" class="text-c_mauve decoration-dotted hover:underline hover:cursor-pointer overflow-hidden text-nowrap" href={post.url}>
{post.frontmatter.title}
</a>
<span class="dots overflow-hidden text-nowrap flex-grow"></span>
<p class="flex">{post.frontmatter.author}</p>
</li>
)}
</ul>
</div>
<div class="flex m-auto text-left float left max-w-[32rem]">
<a tabindex="0" href="../" class="flex w-max text-c_mauve decoration-dotted hover:underline hover:cursor-pointer mb-4">« Back</a>
</div>
</div>
</Layout>
<script>
// JavaScript to dynamically generate dots between the title and author
document.querySelectorAll('.dots').forEach(span => {
const parentWidth = span.parentElement.clientWidth;
const titleWidth = span.previousElementSibling.offsetWidth;
const authorWidth = span.nextElementSibling.offsetWidth;
const dotsCount = Math.floor((parentWidth - titleWidth - authorWidth) / 8.25); // 8px per dot
span.textContent = '.'.repeat(dotsCount);
});
</script>

56
src/pages/index.astro Normal file
View File

@@ -0,0 +1,56 @@
---
import Layout from "../layouts/Layout.astro";
import GlobalLogo from "../components/GlobalLogo.astro";
import HomeFooter from "../components/HomeFooter.astro";
const allPosts = Object.values(
import.meta.glob("./posts/*.md", { eager: true }),
)
.sort((a: any, b: any) => {
const dateA = new Date(a.frontmatter.pubDate);
const dateB = new Date(b.frontmatter.pubDate);
return dateB - dateA; // Sort descending (newest first)
})
.slice(0, 5);
---
<Layout>
<div class="text-center font-unifont">
<GlobalLogo />
<div
class="flex flex-col max-w-[32rem] m-auto items-center border-4 border-double p-2 mb-12 border-c_text"
>
<h5 class="flex justify-between">Latest Posts:</h5>
<ul class="w-full">
{
allPosts.map((post: any) => (
<li class="flex w-full items-center">
<a
tabindex="0"
class="text-c_mauve decoration-dotted hover:underline hover:cursor-pointer overflow-hidden text-nowrap"
href={post.url}
>
{post.frontmatter.title}
</a>
<span class="dots overflow-hidden text-nowrap flex-grow" />
<p class="flex">{post.frontmatter.author}</p>
</li>
))
}
</ul>
</div>
<HomeFooter />
</div>
</Layout>
<script>
// JavaScript to dynamically generate dots between the title and author
document.querySelectorAll(".dots").forEach((span) => {
const parentWidth = span.parentElement.clientWidth;
const titleWidth = span.previousElementSibling.offsetWidth;
const authorWidth = span.nextElementSibling.offsetWidth;
const dotsCount = Math.floor(
(parentWidth - titleWidth - authorWidth) / 8.25,
); // 8px per dot
span.textContent = ".".repeat(dotsCount);
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,189 @@
---
layout: ../../layouts/MarkdownPostLayout.astro
title: 'Relearning Programming - Introduction'
pubDate: 2025-06-24
author: 'heaven'
---
![](./_assets/relearn-programming.png)
# Foreword
Hey,
I suck at coding - and that's why I decided to relearn programming. My language of choice is C++. I've been working with this language for a long time now, and it just grew on me like no other language did.
# What Led Me Here
I've been struggling with my problem solving + the core concepts of C++ itself. Even though I am aware of the fact that it's totally common to make mistakes, I've had the overwhelming feeling of frustration and "imposter syndrome". Every piece of information was
floating around in my head with no structure. Toss in ADHD and boom. That's how you replicate the feeling.
I tolerated it for too long.
# My Plan And Goals
My goals with relearning programming and C++ is to start with the bare basics and thoroughly study and apply my knowledge with a modern approach to C++. During this journey I will make sure to deep dive into every concept where my skills are lacking. I will make sure to
fully understand each assignment, each function call, each class and each line of code.
I will make sure to create plenty of small exercises & projects. The exercises give me the freedom to experiment with certain features and
to puzzle together solutions, which then can be finally implemented into the projects. These projects can be small games, utility tools or
simply just code snippets. Old C++ code repels me, so Im sticking to C++20 for now and moving to C++23 soon.
Nearly everything I learn and code will be talked about in this series of blog posts. This will make sure that I summarize and explain
the material in my own words. The length of the posts might vary. Sometimes I will talk about more than one concept in one post. Some
concepts are too short to write a 500 word post about.
# What This Series Will Look Like
- Notes from studying C++ / programming concepts in my own words
- Small exercises to experiment
- Projects to apply what I've learned (Games, utilities, code snippets)
- Mistakes I make along the way + solutions to them
- Occasional rants, schizophrenia and dog pictures
# Starting Point
Right now, I know a lot, but at the same time, I don't know anything. I struggle with the understanding of how everything is running
under the hood. This is a crucial point to be aware of, because each decision you take has influence on the logic and performance of
your program. Not to mention the cruciality of the architecture.
# Closing Thoughts
I feel motivated and nervous at the same time. This will be a long, but quick journey. Beside me mentioning that I suck at programming
and that "I don't know anything", I'm pretty sure that I'll profit of my past experience and knowledge.
I'm so hyped to show off my future projects and I'll try my best to entertain you via some text and images. It's quite hard to pull
off, if I am being honest.
To my future me ever reading this: Do not fucking skip anything.
```cpp
#pragma once
#include <string>
#include <filesystem>
#include <unordered_map>
#include "raylib.h"
#include "fmt/core.h"
#include "fmt/color.h"
// Engine Imports
#include "AssetHandle.hpp"
#include "Utils.hpp"
namespace DREAM {
template<typename T>
struct AssetLoader;
template<>
struct AssetLoader<Texture2D> {
Texture2D load(const std::string& path) {
std::string fullPath = Utils::buildFullPath(path);
Image tempImage = LoadImage(fullPath.c_str());
if (!IsImageValid(tempImage)) {
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetLoader::load::IsImageValid: Failed to load image -> {} \n",
path
);
return {};
}
Texture2D tempTex = LoadTextureFromImage(tempImage);
UnloadImage(tempImage);
if (!IsTextureValid(tempTex)) {
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetLoader::load::IsTextureValid: Failed to load texture -> {} \n",
path
);
return {};
}
return tempTex;
}
Texture2D get(AssetHandle handle, const std::unordered_map<AssetHandle, Texture2D>& map) {
auto it = map.find(handle);
if (it != map.end()) {
return it->second;
}
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetManager::getTexture: Texture not found -> {} \n",
handle.id
);
return {};
}
};
template<>
struct AssetLoader<Font> {
Font load(const std::string& path) {
std::string fullPath = Utils::buildFullPath(path);
Font tempFont = LoadFont(fullPath.c_str());
if (!IsFontValid(tempFont)) {
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetLoader::load::IsFontValid: Failed to load font -> {} \n",
path
);
return {};
}
return tempFont;
}
};
template<>
struct AssetLoader<Sound> {
Sound load(const std::string& path) {
std::string fullPath = Utils::buildFullPath(path);
Sound tempSound = LoadSound(fullPath.c_str());
if (!IsSoundValid(tempSound)) {
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetLoader::load::IsSoundValid: Failed to load sound -> {} \n",
path
);
return {};
}
return tempSound;
}
};
template<>
struct AssetLoader<Music> {
Music load(const std::string& path) {
std::string fullPath = Utils::buildFullPath(path);
Music tempMusic = LoadMusicStream(fullPath.c_str());
if (!IsMusicValid(tempMusic)) {
fmt::print(
fmt::emphasis::bold | fmt::fg(fmt::color::light_coral),
"AssetLoader::load::IsMusicValid: Failed to load music -> {} \n",
path
);
return {};
}
return tempMusic;
}
};
}
```
---
*"Using no way as a way, having no limitation as limitation"</br>
~ Bruce Lee*

11
src/pages/rss.xml.js Normal file
View File

@@ -0,0 +1,11 @@
import rss, { pagesGlobToRssItems } from '@astrojs/rss';
export async function GET(context) {
return rss({
title: 'heaven',
description: 'Blog and co.',
site: context.site,
items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')),
customData: `<language>en-us</language>`,
});
}

17
src/styles/global.css Normal file
View File

@@ -0,0 +1,17 @@
@font-face {
font-family: 'Unifont';
src: url('/public/fonts/unifont.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Gohu';
src: url('/public/fonts/gohu.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'Unifont', sans-serif;
}

19
tailwind.config.mjs Normal file
View File

@@ -0,0 +1,19 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {
fontFamily: {
unifont: ["Unifont", "sans-serif"], // Use Unifont as the default sans font
gohu: ["Gohu", "sans-serif"], // Use Unifont as the default sans font
},
colors: {
c_mauve: "#a292a3",
c_crust: "#0B0A0A",
c_text: "#c5c9c5",
c_surface0: "#2A2727",
},
},
},
plugins: [require("@tailwindcss/typography")],
};

5
tsconfig.json Normal file
View File

@@ -0,0 +1,5 @@
{
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}