initial commit

This commit is contained in:
gome 2022-04-22 23:01:03 -05:00
commit 9652ff1a26
9 changed files with 268 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
webroot

32
gemroot/alsare.gmi Normal file
View File

@ -0,0 +1,32 @@
# Alsare
Name for my personal computer. I coined the Old English term "Æþelsearu" from roots meaning "noble machine". "Alsare" is a phonetic projection of what it might have developed into in modern English.
The font is Colossal, by "Jonathon - jon@mq.edu.au", via patorjk's ASCII font tool. I added the letter forms for ash Æ and thorn Þ, as well as the flourish.
=> https://patorjk.com/software/taag/ patorjk's ASCII tool
=> arumi.gmi Almy
=> altior.gmi Altior
=> index.gmi Index
```
d88888888888 888 8888888888 888 .d8888b. 8888888888 d8888 8888888b. 888 888
d88888 8888888b. 888 888 d88P Y88b 888 d88888 888 Y88b 888 888
d88P888 888 "Y88b 888 888 Y88b. 888 d88P888 888 888 888 888
d88P 8888888 888 888 8888888 888 "Y888b. 8888888 d88P 888 888 d88P 888 888
d88P 888 888 888 888 888 "Y88b. 888 d88P 888 8888888P" 888 888
d88P 888 888 .d88P 888 888 "888 888 d88P 888 888 T88b 888 888
d8888888888 8888888P" 888 888 Y88b d88P 888 d8888888888 888 T88b Y88b. .d88P
d88P 8888888888 888 8888888888 88888888 "Y8888P" 8888888888 d88P 888 888 T88b "Y88888P"
888 888 .d888
888 888 d88P
888 888 888
888 8888b. 888 .d8888b 8888b. 888d888 .d88b. 888
888 "88b 888 88K "88b 888P" d8P Y8b 888
888 .d888888 888 "Y8888b. .d888888 888 88888888 888
Y88b. 888 888 888 X88 888 888 888 Y8b. .d88P
"Y888888888888888888888888888 "Y888888 888 88888P' "Y888888 888 "Y8888 888888888888888888888888888P"
```

34
gemroot/altior.gmi Normal file
View File

@ -0,0 +1,34 @@
# Altior
Name for my work computer.
Latin for "higher" or "deeper".
Serif font by me.
=> alsare.gmi Alsare
=> arumi.gmi Almy
=> index.gmi Index
```
.8. 'Y88P' gpooooooooooooqg 'Y88P' ..oooo... 'Yooooooooo.
.8'8. 88 ' 88 ' 88 .o' 'Y8b 88 '8b.
.8' '8. 88 88 88 .P 'Yb. 88 '88
.8' '8. 88 88 88 d' Y8. 88 .88
.8' '8. 88 88 88 d8 8b 88 .8'
.8' '8. 88 88 88 88 88 888oooooP'
.8boooooooood8. 88 88 88 Y8 8P 88 '8b
.8' '8. 88 88 88 '8b .P 88 '8b
.8' '8. 88 88 88 'Yb. d' 88 '8b
.8' '8. 88. o 88 88 Y8b. .o' 88 '8b
.d88b. .d88b. .d888boooood8 .d88b. .d88b. '''booo'' .d88b. '8bo.
'8ooooooog .poooqg. goooooooog '88. .88' '88. .88' '88. '88' '88. '88' '88'
88 ' .8 ' ' 88 ' 888. .888 888. .888 '8b .8' '8b .8' 88
88 . Y8. 88 88'8. .8'88 88'8. .8'88 '8b.8' '8b.8' 88
88oooo8 Y8b 88 88 '8. .8' 88 88 '8. .8' 88 '88. '88. 88
88 ' '8b 88 88 '8. .8' 88 88 '8. .8' 88 .8'Y8. .8'Y8. 88
88 . . 8' 88 88 '8.8' 88 88 '8.8' 88 .8' Y8b .8' Y8b 88
.88oooooo8 '8boodP' .88. O .88. '8' .88. .88. '8' .88. .88. '88. .88. '88. .88.
```

45
gemroot/arumi.gmi Normal file
View File

@ -0,0 +1,45 @@
# Almy
Name for my old Dell Optiplex 790, after it crapped out and I transferred its previous title, "Alsare", to another computer. It's the first machine I ran Linux on (Arch btw)!
"Arumi" is Japanese for "rough sea". "Almy" is an alternative way of transliterating the word into English, which preserves the "Al-" naming convention I follow.
The ASCII art for the kanji is original. The roman letters are based on Colossal by Jonathan (see Alsare's page), but I shortened the letters and made a modified symmetric version of the "A".
=> alsare.gmi Alsare
=> altior.gmi Altior
=> index.gmi Index
```
88o 88o d88b
888b 888b 'b. 8888' .oo.
888 888 .oo. 888. 88888888888888888888888888b
888888888888888888888888888888888888888b '888 .888
88P 88P '8P .88&
888b b. .88' oo. oo.
888 .oo. '88b. 88' 888888888888888888888b
888888888888888888888888888888888888888b '888b 888' 888' 888'
888 '8P . 888 888 888
888 d .88' .88' .88'
888boooooooooooooooooooooo. d' 88P 88P 88P .oo.
'8888888888888888888888888' d888888888888888888888888888888888b
ooo. ooo. ooo. .8' .88' .88' .88'
888P 888P 888P 88 888 888 888
d88' 888 888 'o.d88 .88P .88P .88P .oo.
d88P 888 888 o 8888 888888888888888888888888888b
d8888' Y8P 888. .888 '888 88P 888
.8888P '888888888888 8888 d8b. .888
'8888888P 888' 8888888P'
''''
db 888 888b d888 Y88b d88P
d88b 888 8888b d8888 Y88b d88P
d8PY8b 888 88888b.d88888 Y88o88P
d8P Y8b 888 888Y88888P888 Y888P
d8P Y8b 888 888 Y888P 888 888
d8888888888b 888 888 Y8P 888 888
d8P Y8b 88888888 888 " 888 888
```

22
gemroot/index.gmi Normal file
View File

@ -0,0 +1,22 @@
```
 a88888b. dP dP
d8' `88 88 88 `8b `8b
.d8888b. .d8888b. 88d8b.d8b. .d8888b. 88 d8P 88 .d8888b. d8888P 88d888b. 88 .d8888b. .oo. .d `8b `8b
88' `88 88' `88 88'`88'`88 88ooood8 88 Yo8b88 88' `"" 88 88' `88 88 88888888 88' `"" dP" "d8P .8P .8P
88. .88 88. .88 88 88 88 88. ... Y8.  88. ... 88 88 88 88. ... .8P .8P
`8888P88 `88888P' dP dP dP `88888P'  Y88888P' `88888P' dP dP dP `88888P'
.88
d8888P
```
# Welcome to gome's gemsite
All I have right now is some cool ASCII art I made for my different machine names.
## Machine names
These are ASCII art logos I made for different computers of mine. I always start machine names with "Al-", starting with my first laptop, "Aldo", but I don't have an ASCII art logo for it.
=> alsare.gmi Alsare
=> arumi.gmi Almy
=> altior.gmi Altior

25
readme.md Normal file
View File

@ -0,0 +1,25 @@
# Ctrl-C stuff
Any miscellaneous Ctrl-C-related files I want to track.
I keep full, stand-alone projects in their own repos, but this is just extra bits and bobs.
## Gemini site
[My gemsite](gemini://gemini.ctrl-c.club/~gome) is very small right now.
If it gets bigger eventually, I may move it to its own repo.
## Word of the Day Script (wotd-pack)
I have a Word of the Day feature on my [user site](https://ctrl-c.club/~gome).
The tool here takes a [CSV file](https://tildegit.org/gome/gomesite/src/branch/main/wotd/wotd_data.csv)
of entries and converts them into [JSON files](https://tildegit.org/gome/gomesite/src/branch/main/wotd)
that the [script on my gomepage](https://tildegit.org/gome/gomesite/src/branch/main/index.html#L255) fetches and displays.
To run it, you need [Deno](https://deno.land/).
You can either run it or install it with the included commands.
Calling it looks something like this:
```
# wotd-pack wotd_data.csv
```
Where `wotd_data.csv` is a CSV file formatted like the [one for my site](https://tildegit.org/gome/gomesite/src/branch/main/wotd/wotd_data.csv).
If you actually would like to use this tool and want clearer or more detailed documentation on how to use it, email me at `gome@ctrl-c.club`
or just open an issue on this repository.

1
wotd-pack/install Executable file
View File

@ -0,0 +1 @@
deno install -f --allow-read --allow-write ./wotd-pack.ts

1
wotd-pack/run Executable file
View File

@ -0,0 +1 @@
deno run --allow-read --allow-write ./wotd-pack.ts

107
wotd-pack/wotd-pack.ts Normal file
View File

@ -0,0 +1,107 @@
import { readCSV } from 'https://deno.land/x/csv/mod.ts';
import { datetime } from 'https://deno.land/x/ptera/mod.ts';
import { EOL } from 'https://deno.land/std/fs/eol.ts';
import { brightCyan, yellow, gray } from 'https://deno.land/std@0.117.0/fmt/colors.ts';
if (!Deno.args.length) {
console.warn('Please provide a filename');
} else {
const fileExists = await doesFileExist(Deno.args[0]);
if (fileExists !== true) {
console.error(fileExists);
Deno.exit(-1);
}
}
const date = parseDate(Deno.args[1]);
let skip: number;
skip = Number.parseInt(Deno.args[2] ?? '0', 10);
if (isNaN(skip)) {
console.error(`Invalid skip argument "${Deno.args[2]}".`);
Deno.exit(-1);
}
const file = await Deno.open(Deno.args[0], { read: true, write: false });
let dateOffset = 0;
// really starts at one because it's incremented right away in loop
let rowIndex = 0;
for await (const row of readCSV(file, { lineSeparator: Deno.build.os === 'windows' ? EOL.CRLF : EOL.LF })) {
rowIndex++;
let entry: WotdEntry|undefined;
let word: string|undefined = undefined;
for await (const cell of row) {
if (!cell || rowIndex <= skip) {
continue;
} else if (!word) {
word = cell;
} else if (!entry) {
entry = { word, pronunciation: cell, definitions: [] };
} else {
if (['Noun', 'Verb', 'Adjective', 'Prefix'].includes(cell)) {
entry.definitions.push({ part: cell, definitions: [] });
} else if (entry.definitions.length) {
entry.definitions[entry.definitions.length - 1].definitions.push(cell);
} else {
console.error(`Parsing error! Missing a part of speech in row ${rowIndex}.`);
Deno.exit(-1);
}
}
}
if (entry) {
const filename = date.add({ day: dateOffset }).format('YYYY.MM.dd');
await Deno.writeTextFile(filename + '.json', JSON.stringify(entry));
console.info(`Wrote ${brightCyan(entry.word)} to ${yellow(filename) + gray('.json')}`);
dateOffset++;
}
}
async function doesFileExist(filename: string): Promise<true|string> {
try {
const stat = await Deno.stat(filename);
if (stat.isFile) {
return true;
} else if (stat.isDirectory) {
return 'This is a directory. Need a file';
} else { // isSymlink
return 'This is a symbolic link. Need a file';
}
} catch (e) {
if (e instanceof Deno.errors.NotFound) {
return 'File not found.';
} else if (e instanceof Deno.errors.PermissionDenied) {
return 'Permission denied to access that file.';
} else {
return `Error: ${e.name} (${e.code})`;
}
}
}
function parseDate(date?: string) {
if (!date || date === '-') {
return datetime();
} else {
const parsed = datetime().parse(
date.length === 5
// if it's short, add the year
? date + '-' + datetime().year
: date, 'MM-dd-YYYY'
);
if (parsed.isValid()) {
return parsed;
} else {
console.error(`Invalid date argument "${date}".`);
Deno.exit(-1);
}
}
}
type WotdEntry = {
word: string;
pronunciation: string;
definitions: {
part: string;
definitions: string[];
}[];
}