Compare commits
7 Commits
910f531207
...
4f25a3bc3d
Author | SHA1 | Date | |
---|---|---|---|
4f25a3bc3d | |||
41d67d7a98 | |||
7500465542 | |||
c2e1817567 | |||
6198ca2a35 | |||
a0a926d346 | |||
f9021b7712 |
@ -4,7 +4,6 @@ import Pages from '../public/external.json';
|
||||
function QuickLinks() {
|
||||
return (
|
||||
<div className='block'>
|
||||
<h2>Quick Links</h2>
|
||||
{
|
||||
Object.entries(Pages).map(([title, link], i) => {
|
||||
const extern = link.match(/^http/) && `blue extern` || '';
|
||||
|
@ -30,6 +30,8 @@ function Title() {
|
||||
if (pagePath !== '/') {
|
||||
const subPaths = pagePath.split('?')[0].split('#')[0].split('/');
|
||||
for (const p of subPaths.slice(1, subPaths.length)) {
|
||||
if (!p)
|
||||
continue;
|
||||
splitPath.push({ name: currRoot[p].title, path: p });
|
||||
|
||||
if (currRoot === undefined
|
||||
|
37
lib/date.ts
37
lib/date.ts
@ -14,22 +14,43 @@ const months = [
|
||||
'December'
|
||||
];
|
||||
|
||||
function get12HourTime(pdate: Date | string): string {
|
||||
const date = (typeof pdate === 'string') ? new Date(pdate) : pdate;
|
||||
let hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
let meridiem = 'A.M.';
|
||||
|
||||
let strhours = ''
|
||||
|
||||
if (hours > 12) {
|
||||
hours -= 12;
|
||||
meridiem = 'P.M.';
|
||||
}
|
||||
|
||||
if (hours === 0)
|
||||
hours = 12;
|
||||
|
||||
return `${hours}:${minutes < 10 ? '0' : ''}${minutes} ${meridiem}`;
|
||||
|
||||
}
|
||||
|
||||
function toHumanReadableDate(date: Date | string, disable?: { year?: boolean, month?: boolean, day?: boolean }) {
|
||||
const oDate = (typeof date === 'string') ? new Date(date) : date;
|
||||
|
||||
const year = oDate.getFullYear();
|
||||
const month = months[oDate.getMonth()];
|
||||
const day = oDate.getDate();
|
||||
|
||||
let out = !disable?.day ? `${day}${getOrdinalDaySuffix(day)}` : '';
|
||||
out = !disable?.month ? `${out} ${month}` : out;
|
||||
out = !disable?.year ? `${out} ${year}` : out;
|
||||
const suffix = getOrdinalDaySuffix(day)
|
||||
let out = '';
|
||||
out = !disable?.month ? `${month}` : '';
|
||||
out = !disable?.day ? `${out} ${day}${suffix}` : out;
|
||||
out = !disable?.year ? `${out}, ${year}` : out;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
export function getOrdinalDaySuffix(day: number) {
|
||||
export function getOrdinalDaySuffix(day: number): string {
|
||||
switch (day) {
|
||||
case 1:
|
||||
case 21:
|
||||
@ -46,6 +67,11 @@ export function getOrdinalDaySuffix(day: number) {
|
||||
}
|
||||
}
|
||||
|
||||
export function toLocaleString(pdate: Date | string): string {
|
||||
const date = (typeof pdate === 'string') ? new Date(pdate) : pdate;
|
||||
return `${toHumanReadableDate(date)} at ${get12HourTime(date)}`;
|
||||
}
|
||||
|
||||
export function toRelativeDate(date: Date | string): string {
|
||||
const oDate = (typeof date === 'string') ? new Date(date) : date;
|
||||
|
||||
@ -100,6 +126,7 @@ const DateTool = {
|
||||
getFullMonth,
|
||||
isValid,
|
||||
getOrdinalDaySuffix,
|
||||
toLocaleString,
|
||||
};
|
||||
|
||||
export default DateTool;
|
||||
|
@ -8,7 +8,6 @@ const config = {
|
||||
{
|
||||
test: /\.ya?ml$/,
|
||||
use: 'js-yaml-loader',
|
||||
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
|
@ -3,50 +3,61 @@
|
||||
A handy list of blog posts, articles, videos, and books that I would probably
|
||||
refer to someone or within something.
|
||||
|
||||
- Untangling Lifetimes: The Arena Allocator
|
||||
## Memory Allocation Strategies
|
||||
|
||||
- https://www.gingerbill.org/series/memory-allocation-strategies/
|
||||
|
||||
## Untangling Lifetimes: The Arena Allocator
|
||||
|
||||
Making performant dynamic manual memory management in C feel almost like
|
||||
garbage collection.
|
||||
|
||||
https://www.rfleury.com/p/untangling-lifetimes-the-arena-allocator
|
||||
- https://www.rfleury.com/p/untangling-lifetimes-the-arena-allocator
|
||||
|
||||
- Ryan Fleury's UI Series
|
||||
## Immediate-Mode Graphical User Interfaces (2005)
|
||||
|
||||
- https://caseymuratori.com/blog_0001
|
||||
|
||||
- https://www.youtube.com/watch?v=Z1qyvQsjK5Y
|
||||
|
||||
## What Color is Your Function?
|
||||
|
||||
- https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
|
||||
|
||||
## Real-time audio programming 101: time waits for nothing
|
||||
|
||||
- http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing
|
||||
|
||||
## Triangulation
|
||||
|
||||
- https://www.humus.name/index.php?ID=228
|
||||
|
||||
## Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
|
||||
|
||||
- https://people.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf
|
||||
|
||||
## Typing is Hard
|
||||
|
||||
- https://3fx.ch/typing-is-hard.html
|
||||
|
||||
## The Aggregate Magic Algorithms
|
||||
|
||||
- http://aggregate.org/MAGIC/
|
||||
|
||||
## Ryan Fleury's UI Series
|
||||
|
||||
Semi-paywalled
|
||||
|
||||
https://www.rfleury.com/p/ui-series-table-of-contents
|
||||
- https://www.rfleury.com/p/ui-series-table-of-contents
|
||||
|
||||
- Immediate-Mode Graphical User Interfaces (2005)
|
||||
## You Could Have Invented Monads! (And Maybe You Already Have.)
|
||||
|
||||
https://caseymuratori.com/blog_0001
|
||||
- http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
|
||||
|
||||
https://www.youtube.com/watch?v=Z1qyvQsjK5Y
|
||||
## Fix Your Timestep!
|
||||
|
||||
- What Color is Your Function?
|
||||
- https://gafferongames.com/post/fix_your_timestep/
|
||||
|
||||
https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
|
||||
## UTF-8 Everywhere
|
||||
|
||||
- Real-time audio programming 101: time waits for nothing
|
||||
|
||||
http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing
|
||||
|
||||
- Triangulation
|
||||
|
||||
https://www.humus.name/index.php?ID=228
|
||||
|
||||
- Quantifying the Performance of Garbage Collection vs. Explicit Memory
|
||||
Management
|
||||
|
||||
https://people.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf
|
||||
|
||||
- Typing is Hard
|
||||
|
||||
https://3fx.ch/typing-is-hard.html
|
||||
|
||||
- The Aggregate Magic Algorithms
|
||||
|
||||
http://aggregate.org/MAGIC/
|
||||
|
||||
- Memory Allocation Strategies
|
||||
|
||||
https://www.gingerbill.org/series/memory-allocation-strategies/
|
||||
- http://utf8everywhere.org
|
||||
|
@ -39,6 +39,10 @@ values.
|
||||
|
||||
- [SteamDB](https://steamdb.info/)
|
||||
- tracks depot changes, price history, everything steam
|
||||
- [gg.deals](https://gg.deals)
|
||||
- tracks game deals for steam, steam key stores and other platforms
|
||||
- [IsThereAnyDeal](https://isthereanydeal.com)
|
||||
- similar to gg.deals except it does not support key seller tracking
|
||||
- [SteamGifts](https://steamgifts.com/)
|
||||
- giveaway Steam keys or take part in giveaways
|
||||
- [SteamTradeMatcher](https://steamtradematcher.com/)
|
||||
@ -46,11 +50,5 @@ values.
|
||||
- [ArchiSteamFarm](https://asf.justarchi.net)
|
||||
- useful bot written in C# to farm trading cards for owned games that can be
|
||||
sold
|
||||
- [IsThereAnyDeal](https://isthereanydeal.com)
|
||||
- tracks game deals for steam, steam key stores and other platforms
|
||||
- somewhat broken although it is being migrated and modernized, see [New
|
||||
ITAD](https://new.isthereanydeal.com)
|
||||
- [gg.deals](https://gg.deals)
|
||||
- newer than and similar to IsThereAnyDeal with modern UI
|
||||
- [SteamGridDB](https://steamgriddb.com/)
|
||||
- custom video game assets for games available and not available on steam
|
||||
|
@ -9,15 +9,17 @@ function AboutPage() {
|
||||
<Layout >
|
||||
<section className='block'>
|
||||
<p>Paul's Personal Website. I go by <a href='https://github.com/LambdaPaul'>@LambdaPaul</a> on GitHub and <a href='https://x.com/lambda_paul'>@lambda_paul</a> on X/Twitter.</p>
|
||||
<p>Why did I create this?
|
||||
<p>I also have a Gitea server at <a href='https://git.paulw.xyz'>git.paulw.xyz</a> and a Pleroma (ActivityPub/Mastodon-compatible) server at <a href='https://social.paulw.xyz'>social.paulw.xyz</a> as back-ups for my GitHub and X/Twitter.</p>
|
||||
<p>Why did I create this? Why do I have the back-ups?</p>
|
||||
<p>
|
||||
The original motivation was to just play with Next.js as it pretty much did the things I wanted web pages to do. But it came at the cost of needless complexity. As I use the JavaScript/ECMAScript/Whatever-you-want-to-call-it-script more and more, I am convinced that it is not a platform worth pursuing because the more complex it gets, the less control I have over what it does and this platform and its users seems to be okay with that sort of loss. I have been instead pivoting toward things that impressed and got me interested in working with computers.</p>
|
||||
<p>Most services/products are keen on going against what Steph Ango calls <a href='https://stephango.com/file-over-app'>File over app</a>, a philosophy in which you prioritize data over software, and anticipate and embrace the eventual death of software. People instead want subscription services that barely support open formats and sometimes do not support exporting data to commonly used formats. The goal here is to avoid storing artifacts under locations that are easily not accessible, not under my control, and does not lock me out of using it with other software. The only reason I have not completely abandoned this is thanks to my decision to rely on Markdown files alone. Had it been reliant on any cloud software, I would have started over.</p>
|
||||
|
||||
<p>Got any questions, concerns, or issues? Contact me via email: <code>lambdapaul [at] pm [dot] me</code>.</p>
|
||||
<p>Got any questions, concerns, or issues? Contact me via email: <code>contact [at] paulw [dot] xyz</code>.</p>
|
||||
</section>
|
||||
<hr />
|
||||
<section className='block'>
|
||||
<p>Source for this site is available on GitHub: <a href='https://github.com/LambdaPaul/www'>https://github.com/LambdaPaul/www</a></p>
|
||||
<p>Source for this site is available on GitHub: <a href='https://github.com/LambdaPaul/www'>github.com/LambdaPaul/www</a> and <a href='https://git.paulw.xyz/LambdaPaul/www'>git.paulw.xyz/LambdaPaul/www</a></p>
|
||||
<p>Relevant information regarding the source is available on the repo and is also provided below.</p>
|
||||
</section>
|
||||
<section className='block'>
|
||||
|
@ -7,12 +7,12 @@ import RecentPosts from '../components/recent-posts';
|
||||
import RootInfo from '../public/home.json';
|
||||
|
||||
function Nav() {
|
||||
const nav = RootInfo;
|
||||
const nav = Object.entries(RootInfo);
|
||||
return (
|
||||
<div className='block'>
|
||||
<h2>Navigation</h2>
|
||||
{
|
||||
Object.entries(nav).map(([slug, info], i) => {
|
||||
nav.map(([slug, info], i) => {
|
||||
return <Link key={i} href={slug} className='button green'>{info.title}</Link>
|
||||
})
|
||||
}
|
||||
|
@ -8,11 +8,15 @@ import remarkGithubAdmonitionsToDirectives from 'remark-github-admonitions-to-di
|
||||
|
||||
import Layout from '../../components/layout';
|
||||
import readMarkdown from '../../lib/read-markdown';
|
||||
import { toLocaleString } from '../../lib/date';
|
||||
import NotesInfo from '../../public/notes.json';
|
||||
|
||||
import style from '../../styles/note.module.css';
|
||||
|
||||
interface Note {
|
||||
title: string,
|
||||
mtime: string,
|
||||
content?: string,
|
||||
}
|
||||
|
||||
interface Notes {
|
||||
@ -21,7 +25,7 @@ interface Notes {
|
||||
|
||||
function Markdown({ content }: any) {
|
||||
return <ReactMarkdown
|
||||
remarkPlugins={[remarkGithubAdmonitionsToDirectives, remarkDirective]}
|
||||
remarkPlugins={[remarkGithubAdmonitionsToDirectives, remarkDirective, remarkGfm]}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
components={{
|
||||
code({ node, className, children, ...props }) {
|
||||
@ -47,9 +51,12 @@ function Markdown({ content }: any) {
|
||||
>{content}</ReactMarkdown>
|
||||
}
|
||||
|
||||
function Note({ note }: any) {
|
||||
function Note({ note }: { note: Note } ) {
|
||||
return (<>
|
||||
<Layout >
|
||||
<span className={style['last-updated']}>
|
||||
Last updated: {toLocaleString(note.mtime)}
|
||||
</span>
|
||||
<section className='block'>
|
||||
<Markdown content={note.content} />
|
||||
</section>
|
||||
@ -58,7 +65,7 @@ function Note({ note }: any) {
|
||||
);
|
||||
}
|
||||
|
||||
export async function getStaticProps({ params }: any) {
|
||||
export async function getStaticProps({ params }: { params: { note: string } }) {
|
||||
const note: string = params.note;
|
||||
const notesInfo: Notes = NotesInfo;
|
||||
const noteInfo: Note = notesInfo[note];
|
||||
|
@ -10,6 +10,19 @@ function traverseMap(head: Site, cwd = '', depth = 0) {
|
||||
for (const [slug, info] of Object.entries(head.subpages)) {
|
||||
if (slug === 'sitemap')
|
||||
continue;
|
||||
if (slug.startsWith('http://')) {
|
||||
elements.push(<>
|
||||
<dt>{info.title}</dt>
|
||||
<dd><Link href={slug}>{slug.substring(7)}</Link></dd>
|
||||
</>);
|
||||
}
|
||||
else if (slug.startsWith('https://')) {
|
||||
elements.push(<>
|
||||
<dt>{info.title}</dt>
|
||||
<dd><Link href={slug}>{slug.substring(8)}</Link></dd>
|
||||
</>);
|
||||
}
|
||||
else {
|
||||
const path = `${cwd}/${slug}`;
|
||||
const children = (<><dl style={{marginLeft: '3rem'}}> {traverseMap(info, path, depth + 1)}</dl></>);
|
||||
elements.push(<>
|
||||
@ -18,6 +31,7 @@ function traverseMap(head: Site, cwd = '', depth = 0) {
|
||||
{children}
|
||||
</>);
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
|
@ -10,5 +10,11 @@
|
||||
},
|
||||
"sitemap": {
|
||||
"title": "Site Map"
|
||||
},
|
||||
"https://git.paulw.xyz": {
|
||||
"title": "Git.PaulW.XYZ"
|
||||
},
|
||||
"https://social.paulw.xyz": {
|
||||
"title": "Social.PaulW.XYZ"
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"mos-6502":{"title":"MOS 6502 Microprocessor","mtime":"2023-10-29T18:05:52.439Z"},"zilog-z80":{"title":"Zilog Z80 Microprocessor","mtime":"2023-10-29T18:07:08.579Z"},"steam":{"title":"Steam Client","mtime":"2024-02-13T22:34:17.609Z"},"steam-deck":{"title":"Steam Deck","mtime":"2024-02-13T22:53:51.919Z"},"programming-resources":{"title":"Programming Resources","mtime":"2024-04-20T19:59:46.944Z"},"os":{"title":"Operating Systems","mtime":"2024-05-10T16:07:32.581Z"},"lua":{"title":"Lua Programming Language","mtime":"2024-09-13T08:45:18.515Z"},"browsers":{"title":"Web Browsers","mtime":"2024-09-13T08:47:57.942Z"}}
|
||||
{"mos-6502":{"title":"MOS 6502 Microprocessor","mtime":"2023-10-29T18:05:52.439Z"},"browsers":{"title":"Web Browsers","mtime":"2024-09-13T08:47:57.942Z"},"zilog-z80":{"title":"Zilog Z80 Microprocessor","mtime":"2023-10-29T18:07:08.579Z"},"steam":{"title":"Steam Client","mtime":"2024-10-10T04:56:04.393Z"},"programming-resources":{"title":"Programming Resources","mtime":"2024-10-10T05:04:27.709Z"},"steam-deck":{"title":"Steam Deck","mtime":"2024-10-10T05:19:16.140Z"},"lua":{"title":"Lua Programming Language","mtime":"2024-09-13T08:45:18.515Z"},"os":{"title":"Operating Systems","mtime":"2024-05-10T16:07:32.581Z"}}
|
@ -1 +1 @@
|
||||
{"title":"PaulW.XYZ","subpages":{"posts":{"title":"Posts","subpages":{}},"notes":{"title":"Notes","subpages":{"mos-6502":{"title":"MOS 6502 Microprocessor","mtime":"2023-10-29T18:05:52.439Z"},"zilog-z80":{"title":"Zilog Z80 Microprocessor","mtime":"2023-10-29T18:07:08.579Z"},"steam":{"title":"Steam Client","mtime":"2024-02-13T22:34:17.609Z"},"steam-deck":{"title":"Steam Deck","mtime":"2024-02-13T22:53:51.919Z"},"programming-resources":{"title":"Programming Resources","mtime":"2024-04-20T19:59:46.944Z"},"os":{"title":"Operating Systems","mtime":"2024-05-10T16:07:32.581Z"},"lua":{"title":"Lua Programming Language","mtime":"2024-09-13T08:45:18.515Z"},"browsers":{"title":"Web Browsers","mtime":"2024-09-13T08:47:57.942Z"}}},"about":{"title":"About"},"sitemap":{"title":"Site Map"}}}
|
||||
{"title":"PaulW.XYZ","subpages":{"posts":{"title":"Posts","subpages":{}},"notes":{"title":"Notes","subpages":{"mos-6502":{"title":"MOS 6502 Microprocessor","mtime":"2023-10-29T18:05:52.439Z"},"browsers":{"title":"Web Browsers","mtime":"2024-09-13T08:47:57.942Z"},"zilog-z80":{"title":"Zilog Z80 Microprocessor","mtime":"2023-10-29T18:07:08.579Z"},"steam":{"title":"Steam Client","mtime":"2024-10-10T04:56:04.393Z"},"programming-resources":{"title":"Programming Resources","mtime":"2024-10-10T05:04:27.709Z"},"steam-deck":{"title":"Steam Deck","mtime":"2024-10-10T05:19:16.140Z"},"lua":{"title":"Lua Programming Language","mtime":"2024-09-13T08:45:18.515Z"},"os":{"title":"Operating Systems","mtime":"2024-05-10T16:07:32.581Z"}}},"about":{"title":"About"},"sitemap":{"title":"Site Map"},"https://git.paulw.xyz":{"title":"Git.PaulW.XYZ"},"https://social.paulw.xyz":{"title":"Social.PaulW.XYZ"}}}
|
7
styles/note.module.css
Normal file
7
styles/note.module.css
Normal file
@ -0,0 +1,7 @@
|
||||
.last-updated {
|
||||
text-align: right;
|
||||
display: block;
|
||||
font-style: italic;
|
||||
font-size: 1rem;
|
||||
margin: 0.5rem 0.75rem;
|
||||
}
|
Loading…
Reference in New Issue
Block a user