Skip to content

Instantly share code, notes, and snippets.

View alexandargyurov's full-sized avatar
🚀

Alexandar Gyurov alexandargyurov

🚀
View GitHub Profile
// 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;
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 })
const blog = blogsTable.filter(blog => blog.slug === blogSlug).pop();
return blog.id
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
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 })
}
// 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)
// 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 (
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>
)
render() {
return (
<div>
{this.state.tableData.map((blog, index) => {
return (
<Article
title={blog.title}
description={blog.description}
date={blog.date}
link={'/blog/' + blog.slug}
const notionTableData = await fetch(
"https://notion-api.splitbee.io/v1/table/4a900f47ce9143b59695cf25d8461893"
).then(res => res.json());
this.setState({ tableData: notionTableData })