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
// place in pages/sitemap.xml.tsx | |
const fs = require('fs') | |
import { endpoint } from '../config' | |
const Sitemap = () => null | |
Sitemap.getInitialProps = async ({ res }) => { | |
if (!res) return {} | |
const folder = 'pages' | |
res.setHeader('content-type', 'application/xml') |
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
git config --global alias.pr '!f() { if [ $# -lt 1 ]; then echo "Usage: git pr <id> [<remote>] # assuming <remote>[=origin] is on GitHub"; else git checkout -q "$(git rev-parse --verify HEAD)" && git fetch -fv "${2:-origin}" pull/"$1"/head:pr/"$1" && git checkout pr/"$1"; fi; }; f' | |
# Usage: git pr 123 (where 123 is the number of the pr) |