Skip to content

Instantly share code, notes, and snippets.

Avatar

Hunter Heston HunterHeston

View GitHub Profile
@HunterHeston
HunterHeston / notion2blog.js
Created May 3, 2020 — forked from SafEight/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
View notion2blog.js
const MY_DOMAIN = "example.com"
const START_PAGE = "https://www.notion.so/example"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@HunterHeston
HunterHeston / notion2blog.js
Created May 3, 2020 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
View notion2blog.js
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@HunterHeston
HunterHeston / upload-json.js
Created Apr 11, 2020
bulk upload json data to firestore
View upload-json.js
const admin = require('./node_modules/firebase-admin');
const collectionKey = 'ExampleCollection'; /* 1. The name of your collection here, case-sensitive. */
const data = require('./data.json'); /* 2. A path to your data in JSON format here. */
admin.initializeApp({
credential: admin.credential.cert({
/* 3. Your ServiceAccount details here. */
'type': 'service_account',
'project_id': '...',
'private_key_id': '...',
@HunterHeston
HunterHeston / meta-tags.md
Created Sep 19, 2019 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
View controlled react form
export default class ControlledForm extends Component {
constructor(props) {
super(props);
this.state = { value1: "", value2: "", value3: "" };
this.handle1 = this.handle1.bind(this);
this.handle2 = this.handle2.bind(this);
this.handle3 = this.handle3.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
View create components from object keys
<ul>
{
Object.keys(this.props.vendors).map((vendor) => {
return <li>{vendor}</li>;
});
}
</ul>
View Generate React Component from Array of Data
var data = [1,2,3,4,5,6,7]
<ul>
{
data.map((value) => {
console.log(vendor);
return <li key=vendor>{data}</li>;
});
}
</ul>