www/pages/recommended.tsx

200 lines
6.9 KiB
TypeScript
Raw Normal View History

2021-12-08 03:38:31 +00:00
import React, { ReactElement } from 'react';
import Layout from '../components/layout';
import style from '../styles/lists.module.css';
type listItem = {
children?: listItem[] | string[];
url?: string;
title: string;
description?: string
};
const list: listItem[] = [
{
title: 'Books',
children: [
{
title: 'Technology',
children: [
{
title: 'C programming',
children: [
{
title: 'The C Programming Language [K&R]',
url: 'https://en.wikipedia.org/wiki/The_C_Programming_Language'
},
{
title: 'Expert C Programming by Peter van der Linden'
},
{
2021-12-08 08:54:18 +00:00
title: 'Practical C Programming by Steve Oualline (outdated like all the books in this section but still good)'
},
{
title: 'Mastering Algorithms with C by Kyle Loudon'
2021-12-08 03:38:31 +00:00
}
]
},
2021-12-08 08:54:18 +00:00
{
title: 'Other Programming',
children: [
'Programming Perl by Larry Wall [Camel Book] (one of the first programming books I used. It probably is outdated but it is written well)',
'Programming Rust: Fast, Safe Systems Development',
'The Rust Programming Language',
'Programming in Lua, Fourth Edition by Roberto Ierusalimschy'
]
},
2021-12-08 03:38:31 +00:00
{
title: 'Operating Systems',
children: [
2021-12-08 08:54:18 +00:00
'Advanced Programming in the Unix Environment by W. Richard Stevens',
'Operating Systems: Design and Implementation by Andrew S. Tanenbaum (I have not had a chance to read his other books on OS. I am not a fan of his networking book though.)'
2021-12-08 03:38:31 +00:00
]
},
// {
// title: 'Networking'
// },
// {
// title: 'Electronics'
// },
{
title: 'Computer Engineering',
children: [
2021-12-08 08:54:18 +00:00
'Making Embedded Systems: Design Patterns for Great Software by Elecia White',
'Computer Organization and Design: the Hardware/Software Interface [Patterson Hennessy]',
'Computer Architecture: A Quantitative Approach [Hennessy Patterson]'
2021-12-08 03:38:31 +00:00
]
},
{
title: 'Compilers',
children: [
{
title: 'Compilers: Principles, Techniques, and Tools [Dragon Book] (discusses theory in detail so it is kind of hard to read)'
}
]
},
{
title: 'Other',
children: [
{
title: 'Definitive Guide to sed: Tutorial and Reference'
}
]
}
]
},
{
title: 'Classics',
description: 'Only the English ones for now.',
children: [
2021-12-08 08:54:18 +00:00
'Christmas Carol',
2021-12-08 03:38:31 +00:00
'A Tale of Two Cities',
'The Mayor of Casterbridge',
'The Citadel',
'Oliver Twist',
'Macbeth',
'Othello',
'Adventures of Huckleberry Finn'
]
},
{
title: 'Language Learning',
children: ['Lingua Latina per se Illustrata (Both parts)']
}
]
},
{
title: 'Movies',
children: [
2021-12-08 08:54:18 +00:00
'Pulp Fiction',
2021-12-08 03:38:31 +00:00
'Blade Runner 2049',
2021-12-08 08:54:18 +00:00
'The Grand Budapest Hotel',
2021-12-08 03:38:31 +00:00
'The Hateful Eight',
'Goodfellas',
'Inception',
'Memento',
2021-12-08 08:54:18 +00:00
'Dune (2021)',
'Hot Fuzz',
'Snatch'
2021-12-08 03:38:31 +00:00
]
},
{
title: 'Music',
2021-12-08 08:54:18 +00:00
children: [
'American Pie by Don McLean',
'L\'Ultima Diligenza by Ennio Morricone'
]
},
{
title: 'Classical Music',
2021-12-08 03:38:31 +00:00
children: [
'Große Fuge Op. 133',
'KV 387',
'KV 448',
2021-12-08 08:54:18 +00:00
'KV 626',
'Piano Sonata No. 2 Mvmt. 3 (Chopin)',
2021-12-08 03:38:31 +00:00
'BWV 1048',
'Prelude in G Minor (Op. 23 No. 5)',
2021-12-08 08:54:18 +00:00
'String Quartet, Op. 20 No. 2 (Haydn)',
'Arabesque No. 1 (Debussy)'
2021-12-08 03:38:31 +00:00
]
},
{
title: 'Video Games',
children: [
'The Legend of Zelda: Breath of the Wild',
2021-12-08 08:54:18 +00:00
'Portal 2',
'Factorio',
'The Witcher 3: The Wild Hunt GOTY Edition (Especially the DLCs)',
'Baba is You',
'Red Dead Redemption'
2021-12-08 03:38:31 +00:00
]
}
];
function mapChild(obj: listItem | string, level: number) {
if (typeof obj === 'string') {
if (obj === '')
return <></>
return <span className={style.listItem}>{obj}</span>
}
if (obj.title === '')
return <></>
if (obj.url)
return <span className={style.listItem}><a href={obj.url}>{obj.title}</a></span>
if (!obj.children)
return <span className={style.listItem}>{obj.title}</span>
let title: ReactElement;
if (level >= 0 && level <= 4)
title = React.createElement(`h${level + 2}`, {}, obj.title);
else
title = React.createElement('strong', {}, obj.title);
return (
<>
{title}
{obj.description ? <p>{obj.description}</p> : <></>}
<div>
{obj.children.map(l => mapChild(l, level + 1))}
</div>
</>
);
}
function Recommended() {
return (
<Layout name='Recommended' title='My Recommendations'>
<section className='block'>
<p>This page is really for me to not forget/revisit the good things I have read, seen, heard, and/or experienced. This list may change, just as my opinions.</p>
2021-12-08 08:54:18 +00:00
<p>If the one you are looking for is not on this list, it is most likely I have not had the chance to read/listen to/watch it yet.</p>
2021-12-08 03:38:31 +00:00
{list.map(l => mapChild(l, 0))}
</section>
</Layout>
);
}
export default Recommended;