From 23abf2c6efefe4c394eb5b590fb4dde940a52919 Mon Sep 17 00:00:00 2001 From: Pradip Caulagi Date: Thu, 7 Sep 2023 19:55:40 +0200 Subject: [PATCH] Create a quotation component and use it in files --- _posts/complementing-python-with-rust.mdx | 9 +++--- _posts/first-look-at-golang.mdx | 9 +++--- _posts/nodejs-vs-django.mdx | 26 +++++++---------- components/post-body.tsx | 18 ++---------- components/quotation.tsx | 35 +++++++++++++++++++++++ 5 files changed, 55 insertions(+), 42 deletions(-) create mode 100644 components/quotation.tsx diff --git a/_posts/complementing-python-with-rust.mdx b/_posts/complementing-python-with-rust.mdx index 002cf7e..cded5c0 100644 --- a/_posts/complementing-python-with-rust.mdx +++ b/_posts/complementing-python-with-rust.mdx @@ -24,11 +24,10 @@ Of the several features that Rust has, I find 3 are particularly relevant to bui **Zero cost abstractions** is something Rust borrows from C++. -> C++ implementations obey the zero-overhead principle: What you don’t use, you don’t pay for. And further: What you do use, you couldn’t hand code any better - -
- Stroustrup -
+ So this language principle would mean that, for features of the language that I don’t use, there should be no penalty. For features of the language that I do use, it shouldn’t be possible to do any better by going down in the stack (i.e. by writing generated machine instructions, for example). One obvious evidence of this is in the trait implementation. Traits is one of the cornerstone’s of the abstraction model in Rust. It allows us to add behaviour to types in a variety of cases. But the design principle and the implementation of this feature guarantees that there is no penalty/overhead for using Traits. See this [excellent post](https://blog.rust-lang.org/2015/05/11/traits.html) for details. diff --git a/_posts/first-look-at-golang.mdx b/_posts/first-look-at-golang.mdx index c3567e8..156bf48 100644 --- a/_posts/first-look-at-golang.mdx +++ b/_posts/first-look-at-golang.mdx @@ -104,11 +104,10 @@ func serveFile(w ResponseWriter, ### Stdlib -> Talk small and carry a big class library - -
- James Robertson, about Smalltalk. -
+ Go is frequently said to be a modern language. This is evident in the standard libraries that come with the language. compress, crypt, html, etc are all libraries any program today would invariably use. In fact, you will notice that the static file server earlier is really tiny. It is due to the fact that stdlib has a complete implementation of a HTTP server with parts that can be easily customized. diff --git a/_posts/nodejs-vs-django.mdx b/_posts/nodejs-vs-django.mdx index c04df14..6eba0eb 100644 --- a/_posts/nodejs-vs-django.mdx +++ b/_posts/nodejs-vs-django.mdx @@ -8,22 +8,16 @@ ogImage: url: 'https://user-images.githubusercontent.com/222507/109427622-7ad93080-79f3-11eb-8411-519e3a696f6f.png' --- - - -
-

A mad tea party, Alice in Wonderland

-
-
- - -

- The table was a large one, but the three were all crowded together at one - corner of it: 'No room! No room!' they cried out when they saw Alice - coming. 'There’s PLENTY of room!' said Alice indignantly, and she sat down - in a large arm-chair at one end of the table. -

-
-
+ We have been using both Django and Nodejs at [WWStay](https://wwstay.com/). We use Django for the customer dashboard and backoffice applications. diff --git a/components/post-body.tsx b/components/post-body.tsx index 52f4791..e8b0d67 100644 --- a/components/post-body.tsx +++ b/components/post-body.tsx @@ -1,26 +1,12 @@ import { MDXRemote, MDXRemoteSerializeResult } from 'next-mdx-remote' -import { - Card, - CardHeader, - CardBody, - CardFooter, - Divider, - Link, - Image, -} from '@nextui-org/react' +import Quotation from './quotation' type PostBodyProps = { source: MDXRemoteSerializeResult } const components = { - Card, - CardBody, - CardHeader, - CardFooter, - Divider, - Link, - Image, + Quotation, } const PostBody: React.FC = ({ source }) => { diff --git a/components/quotation.tsx b/components/quotation.tsx new file mode 100644 index 0000000..e84b091 --- /dev/null +++ b/components/quotation.tsx @@ -0,0 +1,35 @@ +import { Card, CardBody, CardHeader, Divider } from '@nextui-org/react' + +interface QuotationProps { + author: string + quotation: string + reference?: string +} + +const Quotation: React.FC = ({ + author, + quotation, + reference, +}) => { + return ( +
+
+ {reference && ( +
+
+ {reference} +
+
+
+ )} +
{author}
+
+

+ {quotation} +

+
+
+ ) +} + +export default Quotation