diff options
| author | iamcheeseman <[email protected]> | 2026-03-19 16:57:18 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-03-19 16:57:18 -0400 |
| commit | 82edda96ef68a4e4d0695fe1e056b609fdd83074 (patch) | |
| tree | 5eef077fdbd15f109f625a5fd455df0d5fc9e363 | |
hello, world
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | 404.md | 3 | ||||
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | code_highlight.css | 44 | ||||
| -rwxr-xr-x | compile.sh | 15 | ||||
| -rw-r--r-- | favicon.ico | bin | 0 -> 23434 bytes | |||
| -rw-r--r-- | footer.html | 4 | ||||
| -rw-r--r-- | gallary/art/bbwp5x.webp | bin | 0 -> 1818 bytes | |||
| -rw-r--r-- | gallary/art/index.md | 10 | ||||
| -rw-r--r-- | gallary/index.md | 6 | ||||
| -rw-r--r-- | gallary/photo/birdbird.webp | bin | 0 -> 49254 bytes | |||
| -rw-r--r-- | gallary/photo/index.md | 26 | ||||
| -rw-r--r-- | gallary/photo/raspberry_pi.png | bin | 0 -> 1495861 bytes | |||
| -rw-r--r-- | gallary/photo/rice.webp | bin | 0 -> 224518 bytes | |||
| -rw-r--r-- | header.html | 35 | ||||
| -rw-r--r-- | index.md | 32 | ||||
| -rw-r--r-- | projects/git/index.md | 18 | ||||
| -rw-r--r-- | projects/index.md | 14 | ||||
| -rw-r--r-- | projects/site/index.md | 7 | ||||
| -rw-r--r-- | projects/tsarbar/index.md | 21 | ||||
| -rw-r--r-- | ramblings/c-is-the-best/index.md | 247 | ||||
| -rw-r--r-- | ramblings/index.md | 8 | ||||
| -rw-r--r-- | res/birdbird.webp | bin | 0 -> 1808 bytes | |||
| -rw-r--r-- | res/logo.png | bin | 0 -> 2193 bytes | |||
| -rw-r--r-- | styles.css | 129 | ||||
| -rwxr-xr-x | watch_and_host.sh | 8 |
26 files changed, 651 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..54fee9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.html ++header.html ++footer.html @@ -0,0 +1,3 @@ +# 404 + +That page ain't exist. @@ -0,0 +1,21 @@ +Copyright 2026 iamcheeseman + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/code_highlight.css b/code_highlight.css new file mode 100644 index 0000000..9ff177e --- /dev/null +++ b/code_highlight.css @@ -0,0 +1,44 @@ +div.sourceCode { + background-color: black; + + font-family: monospace; + + padding: 0 5px; + margin: 16px 0 !important; + margin-left: 4ch !important; + + border: dotted 2px var(--font-color); +} + +code { + background-color: black; + color: #c4c4c4; + + font-family: monospace; + + border: dotted 1px var(--font-color); + + hyphens: none; +} + +.sourceCode * { + color: #c4c4c4; + padding: 0; + text-transform: none; + overflow: auto !important; + border: none !important; +} + +.dt { color: #5fd65f; } + +.dv { color: #fe86fe; } + +.pp { color: #5fd6d6; } + +.cf { color: white; font-weight: bold; } + +.co { color: #5eaefd; } + +.st, .im { color: #fed686; } + +.sc { color: #5faeae; diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..58c2968 --- /dev/null +++ b/compile.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +md=`find . -name "*.md"` + +for file in $md; do + # build the page into an intermediate file, so when I reload in the browser, + # it's not a 50/50 whether the page is empty or not. + cat header.html > build.html + pandoc -f markdown -t html $file | iconv -f UTF-8 -t ASCII//TRANSLIT >> build.html + cat footer.html >> build.html + cp build.html `echo $file | sed s/\.md$/.html/` +done + +rm build.html + diff --git a/favicon.ico b/favicon.ico Binary files differnew file mode 100644 index 0000000..b349dcb --- /dev/null +++ b/favicon.ico diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..5bb787d --- /dev/null +++ b/footer.html @@ -0,0 +1,4 @@ +<!-- Page content ends here --> + </div> +</body> +</html> diff --git a/gallary/art/bbwp5x.webp b/gallary/art/bbwp5x.webp Binary files differnew file mode 100644 index 0000000..56e9552 --- /dev/null +++ b/gallary/art/bbwp5x.webp diff --git a/gallary/art/index.md b/gallary/art/index.md new file mode 100644 index 0000000..c5d116b --- /dev/null +++ b/gallary/art/index.md @@ -0,0 +1,10 @@ +# Art Gallary + +## Bird-Bird Wallpaper + + + +My wallpaper, and profile picture. You can use it too, but I'll look at you +funny. + +### Oops, looks like I forgot to back up all my art and it got deleted diff --git a/gallary/index.md b/gallary/index.md new file mode 100644 index 0000000..00f9668 --- /dev/null +++ b/gallary/index.md @@ -0,0 +1,6 @@ +# Gallary + +There are two gallaries: + +- The [art gallary](/gallary/art), where I show off some of my pixel art. +- The [photo gallary](/gallary/photo), where I show some real life stuff. diff --git a/gallary/photo/birdbird.webp b/gallary/photo/birdbird.webp Binary files differnew file mode 100644 index 0000000..bd4dbe7 --- /dev/null +++ b/gallary/photo/birdbird.webp diff --git a/gallary/photo/index.md b/gallary/photo/index.md new file mode 100644 index 0000000..5856c80 --- /dev/null +++ b/gallary/photo/index.md @@ -0,0 +1,26 @@ +# Photo Gallary + +## The Bird + + + +I have a bird named Bird-Bird (she came with that name). She's a pineapple +green cheek conure. She's a huge jerk and deserves to be shot. But alas, I love +her. What a shame. + +## The Server + +<!--TODO: change to webp--> + + +This is the server that this website is being hosted from. It's just a lil +Raspberry Pi 5. It also does Git hosting, and you can see the web view at +[git.iamcheeseman.net](https://git.iamcheeseman.net). + +## The Rice + + + +- BSPWM +- Tsarbar +- Neovim diff --git a/gallary/photo/raspberry_pi.png b/gallary/photo/raspberry_pi.png Binary files differnew file mode 100644 index 0000000..c3f1a00 --- /dev/null +++ b/gallary/photo/raspberry_pi.png diff --git a/gallary/photo/rice.webp b/gallary/photo/rice.webp Binary files differnew file mode 100644 index 0000000..7110c7a --- /dev/null +++ b/gallary/photo/rice.webp diff --git a/header.html b/header.html new file mode 100644 index 0000000..c9c1a7d --- /dev/null +++ b/header.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> + +<html lang="en"> +<head> + <title>www.iamcheeseman.net</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width"> + <meta name="description" content="iamcheeseman's hobby website (and stuff)"> + <link rel="stylesheet" href="/styles.css"> + <link rel="stylesheet" href="/code_highlight.css"> +</head> +<body> + <table id="header"> + <tr> + <td class="logo" rowspan="2"> + <img src="/res/logo.png" alt="iamcheeseman's profile picture"> + </td> + <td class="title">www.iamcheeseman.net</td> + </tr> + <tr> + <td class="desc">My beautiful site</td> + </tr> + </table> + + <table class="tabs"> + <tr> + <td><a href="/">about</a></td> + <td><a href="/projects">projects</a></td> + <td><a href="/gallary">gallary</a></td> + <td><a href="/ramblings">ramblings</a></td> + </tr> + </table> + + <div id="content" class="no-start-trans" lang="en"> +<!-- Page content goes here --> diff --git a/index.md b/index.md new file mode 100644 index 0000000..42905fe --- /dev/null +++ b/index.md @@ -0,0 +1,32 @@ +# Welcome + +Welcome to my very own site on the world wide web! I'm a software developer and +pixel artist that primarily makes video games. + +I started programming in when I was ~12 with Python. I'm 20 now, and I make +games in C and Lua. I also continually try out somewhat obscure low level +programming languages, like Odin or C3. + +## Friends + +- [Dot32](https://dot32.dev/) +- [Tturna](https://tturna.com/) +- [Bar](https://detkewldog.netlify.app/) + +## Software That I Use + +- [Neovim](https://neovim.io) +- [BSPWM](https://github.com/baskerville/bspwm) +- [Tsarbar](/projects#tsarbar) +- [st](https://st.suckless.org/) +- [TCC](https://www.bellard.org/tcc/) +- ~~[Aseprite](https://www.aseprite.org/)~~ (Not FOSS) + +## Contact Info + +- E-Mail: [email protected] +- Matrix: iamcheeseman:matrix.tturna.com + +## Socials + +- [YouTube](https://www.youtube.com/@iamcheeseman) diff --git a/projects/git/index.md b/projects/git/index.md new file mode 100644 index 0000000..eb087b4 --- /dev/null +++ b/projects/git/index.md @@ -0,0 +1,18 @@ +\> [go back](/projects) + +# Git Hosting + +My server, on top of hosting this website, also hosts [a Git +server](https://git.iamcheeseman.net) with its massive 256GB storage. I don't +have HTTPS support set up just yet, but that's coming. That means you can't +clone my repos at the moment. + +## Why? + +Cause I wanna own my Git repos, silly. And it's cool to say I have a Git +server. + +## How? + +By following [this Git book](https://git-scm.com/book/en/v2). Chapter 4 is +where it describes the setup on a server. diff --git a/projects/index.md b/projects/index.md new file mode 100644 index 0000000..808a298 --- /dev/null +++ b/projects/index.md @@ -0,0 +1,14 @@ +# Projects + +Yessir, I do actually have projects. This page contains a few relevant ones, +listed in no particular order. + +- [Tsarbar](/projects/tsarbar) + A super cool, super simple status bar for Xorg. +- [This site](/projects/site) +- [Git hosting](/projects/git) + +And here are a couple of miscellaneous projects I haven't bothered to write pages for yet: + +- Gutshot - the project I'm currently working on. +- No! My Substance - A game about going back in time for a spray-on tan. diff --git a/projects/site/index.md b/projects/site/index.md new file mode 100644 index 0000000..dcf103a --- /dev/null +++ b/projects/site/index.md @@ -0,0 +1,7 @@ +\> [go back](/projects) + +# [This Site](https://git.iamcheeseman.net/site) + +This website is fully open source, and you can read the super awesome source +code yourself. Everything is written in markdown, which is turned into HTML +with Pandoc. And best of all: it has no Javascript. diff --git a/projects/tsarbar/index.md b/projects/tsarbar/index.md new file mode 100644 index 0000000..1d011e6 --- /dev/null +++ b/projects/tsarbar/index.md @@ -0,0 +1,21 @@ +\> [go back](/projects) + +# [Tsarbar](https://codeberg.org/iamcheeseman/tsarbar). + +Tsarbar is a simple status bar for Xorg that I made with a friend. It's +configured through a command line utility called `tsarc`. + +Example for a simple clock: + +```bash +$ tsarc set clock -text "`date`" +$ tsarc layout -left clock +``` + +You can replace `clock` with anything and set the text to whatever. Tsarbar +doesn't care. All that needs to happen for the component to display is that 1. +It has text, and 2. It's in the bar layout. + +You can see an example of how it *could* look at the top of this screenshot: + + diff --git a/ramblings/c-is-the-best/index.md b/ramblings/c-is-the-best/index.md new file mode 100644 index 0000000..87d29d7 --- /dev/null +++ b/ramblings/c-is-the-best/index.md @@ -0,0 +1,247 @@ +\> [go back](/ramblings) + +# Rambling: Implementing a Dynamic Array in C + +Have you ever wanted C to have a fully featured, easy-to-use, generic dynamic +array, which can be implemennted in a small of time? + +What if I told you that C can have a full, easy-to-use, generic dynamic array, +which can be implemented in a small amount of time? Because it can. I wrote the +whole thing without testing, and it worked *almost* first try. + +Let's start with the creation of a dynamic array. You might need to scroll +horizontally if your screen is teensy weensy. + +```c +#define DA_MIN_CAP 8 + +// Wrap the function in a macro to make it a little nicer to use. +#define da_create(T, init_cap) \ + ((T*)_da_create(sizeof(T), init_cap)) + +void* _da_create(size_t type_size, int init_cap) { + // Ensure a mimimum capacity. + init_cap = init_cap < DA_MIN_CAP + ? DA_MIN_CAP + : init_cap; + + // Those + 2 ints are our length and capacity. You can use + // whatever integer type you want; int is fine for this use-case. + int* arr = (int*)malloc(type_size * init_cap + sizeof(int) * 2); + + // Which we assign here. + arr[0] = 0; + arr[1] = init_cap; + + return (void*)(arr + 2); +} +``` + +So, we define a function `_da_create()`. It takes in the size of the type you +want to create, and how many elements to reserve space for. It allocates that +space, plus space for two integers. + +Those two integers are your array length and array capacity. They are placed in +front of the array. + +And then we return the pointer we allocated, but offset to point to the start +of your data. Finally, we wrap all this in a nice little macro called +`da_create()` so we don't need to explicitly pass the size and cast the +resulting pointer. + +Tada! You now have a generic dynamic array. Okay, well not really. You have +a heap-allocated array with two useless integers in front. Now, we need to be +able to access those integers in order to make them useful: + +```c +#define da_len_ptr(arr) ((int*)arr - 2) +#define da_len(arr) (*da_len_ptr(arr)) + +#define da_cap_ptr(arr) ((int*)arr - 1) +#define da_cap(arr) (*da_cap_ptr(arr)) +``` + +And now you have access to them. We have a separate macro to get a pointer to +the length/capacity so we can assign it. But anyway, how do you append? Well, +like so: + +```c +// This fancy lil macro just gets the pointer that +// we actually alloc'd. +#define da_base(arr) ((void*)arr - 2) + +// Of course, we wrap it in a macro for convenience. +#define da_append_slot(T, arr) + ((T*)_da_append_slot(sizeof(T), (void*)arr)) + +// This function returns the slot it just appended. +void* _da_append_slot(size_t type_size, void** arr) { + int cap = da_cap_ptr(*arr); + int len = da_len_ptr(*arr); + + (*len)++; + + // If we need space, grow the array. + if (*len > *cap) { + // This won't work if the initial capacity is 0, which + // is why we implemented a minimum. + *cap *= 2; + + // The base array is what realloc expects. + void* base = da_base(*arr); + base = realloc(base, (type_size * *cap) + sizeof(int) * 2); + assert(base != NULL); // Just to handle the case. + *arr = (void*)((int*)base + 2); + + // Update the length so we don't get a use-after-free later. + len = da_len_ptr(*arr); + } + + return *arr + ((*len - 1) * type_size); +} +``` + +So this doesn't actually really truly append anything. It ensures the existence +of a new slot at the end of the array, increments the length, and returns a +pointer to the last element. I didn't want to name it something like +`da_ensure_one()`, because it does a bit more than just make sure there's space +for your new element. + +Anyway, you can append an element onto the end of the array by doing something +like this: + +```c +int* arr = da_create(int, 0); +*da_append_slot(int, &arr) = 5; +``` + +Which you might notice can be wrapped up in a macro: + +```c +#define da_append(T, arr, elem) (*da_append_slot(T, arr) = elem) +``` + +And tada, you now can append elements to your very own dynamic array. And best +of all, you don't need to care too much about the internals in your usage. You +don't need to use some bespoke array data type. You don't need to worry about +storing the length and capacity; it's all already handled for you. + +But before I finish, we need to clean up the array, of course: + +```c +void da_free(void* arr) { + void* base = da_base(arr); + free(base); +} +``` + +Here's a fancy schmancy example of how to use it: + +```c +int main(void) { + uint64_t* arr = da_create(uint64_t, 0); + + // Append some stuff. + for (int i = 0; i < 20; i++) { + da_append(uint64_t, &arr, 900000000000000 + i); + } + + // Show some data. + printf("capacity: %d, length: %d\n", da_cap(arr), da_len(arr)); + for (int i = 0; i < da_len(arr); i++) { + printf("[%d] = %lu\n", i, arr[i]); + } + + da_free(arr); +} +``` + +I'll leave implementing extra methods like `da_remove()` and `da_find()` as an +exercise to the reader. If you know the basics of C, this shouldn't be too +hard, since as you might've noticed, the code for this dynamic array is pretty +similar to how someone would usually implement one. + +<hr> + +For those interested, here's the full source code: + +```c +#include <assert.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#define DA_MIN_CAP 8 + +#define da_create(T, init_capacity) \ + ((T*)_da_create(sizeof(T), init_capacity)) + +#define da_len_ptr(arr) ((int*)arr - 2) +#define da_len(arr) (*da_len_ptr(arr)) + +#define da_cap_ptr(arr) ((int*)arr - 1) +#define da_cap(arr) (*da_cap_ptr(arr)) + +#define da_base(arr) ((void*)da_len_ptr(arr)) + +#define da_append_slot(T, arr) \ + ((T*)_da_append_slot(sizeof(T), (void**)arr)) + +#define da_append(T, arr, elem) (*da_append_slot(T, arr) = elem) + +void* _da_create(size_t type_size, int init_cap) { + init_cap = init_cap < DA_MIN_CAP + ? DA_MIN_CAP + : init_cap; + + int* arr = (int*)malloc(type_size * init_cap + sizeof(int) * 2); + + arr[0] = 0; + arr[1] = init_cap; + return (void*)(arr + 2); +} + +void* _da_append_slot(size_t type_size, void** arr) { + int* cap = da_cap_ptr(*arr); + int* len = da_len_ptr(*arr); + + (*len)++; + + if (*len > *cap) { + *cap *= 2; + + void* base = da_base(*arr); + base = realloc(base, (type_size * *cap) + sizeof(int) * 2); + assert(base != NULL); + *arr = (void*)((int*)base + 2); + + len = da_len_ptr(*arr); + } + + return *arr + ((*len - 1) * type_size); +} + +void da_free(void* arr) { + void* base = da_base(arr); + free(base); +} + +int main(void) { + uint64_t* arr = da_create(uint64_t, 0); + + int* len = da_len_ptr(arr); + for (int i = 0; i < 20; i++) { + da_append(uint64_t, &arr, 900000000000000 + i); + } + + printf("capacity: %d, length: %d\n", da_cap(arr), da_len(arr)); + for (int i = 0; i < da_len(arr); i++) { + printf("[%d] = %lu\n", i, arr[i]); + } + + da_free(arr); +} +``` + +And to be clear: I'm aware of how basic this article is. I just wrote it to +fill out space on my website. diff --git a/ramblings/index.md b/ramblings/index.md new file mode 100644 index 0000000..d3b0274 --- /dev/null +++ b/ramblings/index.md @@ -0,0 +1,8 @@ +# Ramblings + +These are my ramblings. They might occassionally be useful. I hope that over +the years, I amass a large amount of old-man sounding ramblings. + +### 2026 +- [Implementing a Dynamic Array in C](/ramblings/c-is-the-best) - March 10 + diff --git a/res/birdbird.webp b/res/birdbird.webp Binary files differnew file mode 100644 index 0000000..57dfe1a --- /dev/null +++ b/res/birdbird.webp diff --git a/res/logo.png b/res/logo.png Binary files differnew file mode 100644 index 0000000..0045e53 --- /dev/null +++ b/res/logo.png diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..97f566c --- /dev/null +++ b/styles.css @@ -0,0 +1,129 @@ +:root { + --bg-color: #ffd1f0; + --bg-color-2: #86c693; + --bg-color-2-hov: #b8f5b4; + --fg-color: #493b44; + --fg-color-2: #1a271d; + + background: var(--bg-color); + color: var(--fg-color); + + font-family: monospace; + font-size: 16pt; + + -webkit-transition: none !important; + -moz-transition: none !important; + -ms-transition: none !important; + -o-transition: none !important; + transition: 0.2s; +} + +body { + padding: 1em; +} + +#content { + width: 1000px; +} + +div.header { +} + +#header { + margin-bottom: 1em; +} + +#header td { + color: black; +} + +#header .logo img { + display: block; + height: 3em; + margin-right: 10px; +} + +#content img { + display: block; + margin: auto !important; + max-width: 40vw; + max-height: 30vw; + border: solid 1px black; +} + +#content p { + text-indent: 2ch; +} + +a, a:visited { + color: var(--fg-color) !important; + transition: background 2s; +} + +a:hover { + color: var(--fg-color-2) !important; + background: var(--bg-color-2); + transition: background 0.2s; +} + +.tabs a { + margin-right: 2ch; +} + +h1, h2, h3, h4, h5, h6 { + color: black; + font-size: 1rem; +} + +h1 { + border-bottom: solid 2px black; +} + +h2 { + border-bottom: dotted 2px black; +} + +h4, h5, h6 { + font-weight: normal; +} + +h1:before { + content: "# "; + color: var(--bg-color-2) !important; +} + +h2:before { + content: "## "; + color: var(--bg-color-2) !important; +} + +h3:before { + content: "### "; + color: var(--bg-color-2) !important; +} + +h4:before { + content: "#### "; + color: var(--bg-color-2) !important; +} + +h5:before { + content: "##### "; + color: var(--bg-color-2) !important; +} + +h6:before { + content: "###### "; + color: var(--bg-color-2) !important; +} + +hr { + border: none; + border-bottom: solid 2px black; +} + +@media(max-width: calc(1000px + 3em + 8px)) { + #content { + width: auto !important; + } +} diff --git a/watch_and_host.sh b/watch_and_host.sh new file mode 100755 index 0000000..a5dd265 --- /dev/null +++ b/watch_and_host.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +python -m http.server & + +inotifywait -e modify,create,delete -r . -m \ +| while read; do + ./compile.sh +done |
