This file contains 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
Schrödinger’s commit. 50% chance we fixed the bug | |
i tried my best | |
Please don't tell anyone I did this | |
Check the changes for yourself | |
Works on my machine |
This file contains 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
# .gitconfig | |
[user] | |
email = danilowoz@gmail.com | |
[alias] | |
st = status | |
ci = commit | |
br = branch | |
co = checkout | |
up = "!git remote update -p; git merge --ff-only @{u}" | |
emenda = commit --amend --no-edit |
This file contains 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
import * as React from 'react' | |
interface IState { | |
offSet: number | |
} | |
interface IProp { | |
force?: number | |
offsetComp?: number | |
children(offSet: number): React.ReactNode |
This file contains 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
import React, { Component } from "react" | |
import VisibilitySensor from "react-visibility-sensor" | |
const optsVisibily = { | |
minTopValue: 400, | |
partialVisibility: true, | |
scrollDelay: 100 | |
} | |
const WithScroll = WrapComponent => |
This file contains 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
.container { | |
display: flex; | |
flex-flow: column wrap; | |
align-content: space-between; | |
/* Your container needs a fixed height, and it | |
* needs to be taller than your tallest column. */ | |
height: 600px; | |
} | |
.item { |
This file contains 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 { createFilePath } = require(`gatsby-source-filesystem`) | |
exports.onCreateNode = ({ node, actions, getNode }) => { | |
const { createNodeField } = actions | |
if (node.internal.type === `MarkdownRemark`) { | |
const value = createFilePath({ node, getNode }) | |
const [month, day, year] = new Date(node.frontmatter.date) | |
.toLocaleDateString("en-EN", { | |
year: "numeric", |
This file contains 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 path = require(`path`) | |
// 1. This is called once the data layer is bootstrapped to let plugins create pages from data. | |
exports.createPages = ({ graphql, actions }) => { | |
// 1.1 Getting the method to create pages | |
const { createPage } = actions | |
// 1.2 Tell which layout Gatsby should use to thse pages | |
const blogLayout = path.resolve(`./src/layouts/blog-post.js`) | |
// 2 Return the method with the query |
This file contains 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
import React from "react" | |
import { graphql } from "gatsby" | |
const BlogPost = ({ data }) => { | |
const { markdownRemark } = data | |
const imageSource = markdownRemark.frontmatter.image.childImageSharp.fluid.src | |
return ( | |
<> | |
<img src={imageSource} alt={markdownRemark.frontmatter.title} /> |
This file contains 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
Array.from({ length: numPages }).forEach((_, i) => { | |
createPage({ | |
path: i === 0 ? `/blog` : `/blog/page/${i + 1}`, | |
component: blogListLayout, | |
context: { | |
limit: postsPerPage, | |
skip: i * postsPerPage, | |
currentPage: i + 1, | |
numPages, | |
}, |
This file contains 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 postsPerPage = 9 | |
const postsWithoutFeatured = posts.filter(({ node }) => { | |
return !node.frontmatter.featured | |
}) | |
const numPages = Math.ceil(postsWithoutFeatured.length / postsPerPage) |