Skip to content

Instantly share code, notes, and snippets.

View iamkevingreen's full-sized avatar
💭
🍝 🍝 🍝 🍝 🍝 🍝

Kevin Green iamkevingreen

💭
🍝 🍝 🍝 🍝 🍝 🍝
View GitHub Profile
const { json } = require('micro')
const post = require('micro-post')
const updateBlog = require('./api/blog')
module.exports = post(async (req, res) => {
const parsed = await json(req)
switch (parsed.sys.contentType.sys.id) {
case 'blog':
updateBlog(parsed)
const contentfulAPI = require('./contentful')
module.exports = (data) => {
const slug = data.fields.slug['en-US']
contentfulAPI.getEntries({
content_type: 'passports',
'fields.slug': slug,
include: 8
}).then(({ items }) => {
const { createClient } = require('contentful')
const config = require('../config')
module.exports = createClient({
space: config.contentful.space,
accessToken: config.contentful.token
})
const { json } = require('micro')
const post = require('micro-post')
module.exports = post(async (req, res) => {
const parsed = await json(req)
console.log('parsed data', parsed)
})
// Handles all the things ajax cart related,
// based around the timber ajax cart, minus the jquery
import serialize from 'form-serialize'
import fetch from 'unfetch'
const RicherAPI = {}
// tacos
RicherAPI.onCartUpdate = (cart) => {
console.log('items in the cart?', cart.item_count)
accounts-base@1.3.4-rc1522.0
accounts-password@1.4.0
alanning:roles@1.2.16
allow-deny@1.0.9
audit-argument-checks@1.0.7
autoupdate@1.3.12
babel-compiler@6.20.0
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const slash = require(`slash`)
// Implement the Gatsby API “createPages”. This is
// called after the Gatsby bootstrap is finished so you have
// access to any information necessary to programatically
// create pages.
// Will create pages for Wordpress pages (route : /{slug})
{
"dependencies": {
"agentkeepalive": "^3.3.0",
"algoliasearch": "^3.22.2",
"algoliasearch-helper": "^2.20.1",
"alt": "^0.18.4",
"babel-runtime": "^6.23.0",
"basscss": "^8.0.2",
"bcrypt": "^0.8.7",
"body-parser": "^1.17.2",
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor-base@1.1.0 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.19 # The database Meteor supports right now
import React, { Component } from 'react'
import SendBird from 'sendbird'
const SiteStore = require('stores/SiteStore')
const Actions = require('actions/SiteActions')
export default class MemberMessaging extends Component {
constructor(props) {
super(props)