Skip to content

Instantly share code, notes, and snippets.

@viswanathsaj
viswanathsaj / LatestPost.js
Last active May 21, 2024 17:40
Implementation for a load more button in React/NextJS using Ghost CMS
// Make sure you are pulling ALL your posts from the ghost API [No limit]
function LatestPost (props) {
const [ postNum, setPostNum] = useState(3); // Default number of posts dislplayed
function handleClick() {
setPostNum(prevPostNum => prevPostNum + 3) // 3 is the number of posts you want to load per click
}
@gsalgado
gsalgado / go-ethereum-code-walkthrough.md
Last active June 20, 2022 11:42
Code Walkthrough for new block in go-ethereum

Following a block from the network socket to the hard drive

Note: All links to the code are based on a fixed revision, so we can link line numbers. Code might have changed by now, nonetheless use these revisions when doing updates to this document.

Preconditons

  • the app was configured and started
  • all services registered
  • the discovery protocol discovered some nodes
  • the peermanager successfully connected a node
  • established an encrypted multiplexed session