This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dllmain.cpp : Defines the entry point for the DLL application. | |
| #include "pch.h" | |
| #include <Windows.h> | |
| #include <iostream> | |
| // Helper function to compare memory data with a signature | |
| bool MemoryCompare(const BYTE* bData, const BYTE* bMask, const char* szMask) { | |
| for (; *szMask; ++szMask, ++bData, ++bMask) { | |
| if (*szMask == 'x' && *bData != *bMask) { | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const blogId = await this.blogNameToId(this.props.match.params.blogTitle) | |
| const blogData = await fetch( | |
| "https://notion-api.splitbee.io/v1/page/" + blogId | |
| ).then(res => res.json()); | |
| this.setState({ blockMap: blogData }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const blog = blogsTable.filter(blog => blog.slug === blogSlug).pop(); | |
| return blog.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async blogNameToId(blogSlug) { | |
| const blogsTable = await fetch( | |
| "https://notion-api.splitbee.io/v1/table/4a900f47ce9143b59695cf25d8461893" | |
| ).then(res => res.json()); | |
| try { | |
| const blog = blogsTable.filter(blog => blog.slug === blogSlug).pop(); | |
| return blog.id | |
| } catch { | |
| return null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async componentDidMount() { | |
| const blogId = await this.blogNameToId(this.props.match.params.blogTitle) | |
| const blogData = await fetch( | |
| "https://notion-api.splitbee.io/v1/page/" + blogId | |
| ).then(res => res.json()); | |
| this.setState({ blockMap: blogData }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // BlogPost.js | |
| import React from 'react'; | |
| import { NotionRenderer } from "react-notion"; | |
| import "react-notion/src/styles.css"; | |
| import "prismjs/themes/prism-tomorrow.css"; | |
| export default class BlogPost extends React.Component { | |
| constructor(props) { | |
| super(props) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // App.js | |
| import React from 'reactSlug'; | |
| import { Route, Switch, BrowserRouter } from "react-router-dom"; | |
| import Blogs from './pages/Blogs' | |
| import BlogPost from './pages/BlogPost' | |
| class App extends React.Component { | |
| render() { | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Article(props) { | |
| return ( | |
| <div style={{ backgroundColor: '#b0ffc0', borderRadius: 8, padding: 12, margin: 12, width: 'max-content' }}> | |
| <a href={props.link} style={{ textDecoration: 'none' }}> | |
| <h1>{props.title}</h1> | |
| <p>{props.description}</p> | |
| <p>{props.date}</p> | |
| </a> | |
| </div> | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| render() { | |
| return ( | |
| <div> | |
| {this.state.tableData.map((blog, index) => { | |
| return ( | |
| <Article | |
| title={blog.title} | |
| description={blog.description} | |
| date={blog.date} | |
| link={'/blog/' + blog.slug} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const notionTableData = await fetch( | |
| "https://notion-api.splitbee.io/v1/table/4a900f47ce9143b59695cf25d8461893" | |
| ).then(res => res.json()); | |
| this.setState({ tableData: notionTableData }) |
NewerOlder