Skip to content

Instantly share code, notes, and snippets.

View ozantunca's full-sized avatar

Ozan Tunca ozantunca

View GitHub Profile
const { SocksProxyAgent } = require('socks-proxy-agent');
const axios = require('axios');
const agent = new SocksProxyAgent('socks5h://127.0.0.1:9050');
axios({
url: 'https://ifconfig.me',
httpsAgent: agent,
})
.then(({
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-react-helmet-canonical-urls`,
options: {
siteUrl: `https://www.example.com`,
},
},
]
import React, { FC } from 'react';
import { GatsbySeo } from 'gatsby-plugin-next-seo';
const Layout: FC = ({ children }) => (
<>
<GatsbySeo
title='Using More of Config'
description='This example uses more of the available config options.'
openGraph={{
url: 'https://www.example.com/somepage',
import React from 'react';
import { GatsbySeo } from 'gatsby-plugin-next-seo';
export default () => (
<>
<GatsbySeo
title='Simple Usage Example'
description='A short description goes here.'
language='en'
/>
plugins: [
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: '<https://www.example.com>',
sitemap: '<https://www.example.com/sitemap.xml>',
policy: [{ userAgent: '*', allow: '/' }]
}
}
]
plugins: [
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: '<https://www.example.com>',
sitemap: '<https://www.example.com/sitemap.xml>',
policy: [{ userAgent: '*', allow: '/' }]
}
}
]
query: `
{
wp {
generalSettings {
siteUrl
}
}
allSitePage {
nodes {
path
'lorem ipsum dolor sit amet'.replaceAll(' ', '-');
// -> 'lorem-ipsum-dolor-sit-amet'
'lorem ipsum dolor sit amet'.replace(' ', '-');
// -> 'lorem-ipsum dolor sit amet'
'lorem ipsum dolor sit amet'.replace(/ /g, '-');
// -> 'lorem-ipsum-dolor-sit-amet