Skip to content

Instantly share code, notes, and snippets.

View fostergn's full-sized avatar

Gavin Foster fostergn

View GitHub Profile
const addApiIncrease = async (req, res, next) => {
stripe.setApiVersion('2018-05-21');
const billingId = req.account.billing.customer_id;
const newSubscription = await stripe.subscriptions.create({
customer: billingId,
items: [
{
@fostergn
fostergn / custom_code_equation.js
Last active September 6, 2018 18:25
Knack: Update Equation With Connected Record
var scene_key = 'scene_1'
var view_key = 'view_36'
var name_field_key = 'field_1'
var price_field_key = 'field_39'
var connected_record_field_key = 'field_30'
<template>
<div>
<Loading :is-loading="!hasLoadedData" />
<div v-if="hasLoadedData">
<slot />
</div>
</div>
</template>
<script>
@fostergn
fostergn / login.story.js
Created February 15, 2019 18:50
Storybook Component with Store
import { storiesOf } from '@storybook/vue'
import { withKnobs, text, object } from '@storybook/addon-knobs'
import store from '../store'
import '../styles/global.scss'
import Login from '@/components/Login'
import DataWrapper from '@/stories/DataWrapper'
import { initializeApi } from '@knack/api'
window.Knack.Api = initializeApi(ACCOUNT, PASSWORD)
@fostergn
fostergn / storybook-router.js
Last active February 15, 2019 19:02
Storybook Router
.addDecorator(
StoryRouter(
{},
{
initialEntry: `/schema/list/objects/${objectKey}/fields`,
routes: [
{
path: `/schema/list/objects/:objectKey/fields`, component: ObjectListFields
}
]
<<< Knack provisioning started >>>
2019-03-03 13:38:03
<<< stop Knack instances >>>
sudo: systmectl: command not found
<<< update system packages >>>
Hit:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Ign:5 https://sensu.global.ssl.fastly.net/apt xenial InRelease
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
title: 'Gatsby + WordPress Starter',
},
plugins: [
'gatsby-plugin-react-helmet',
HTACCESS_USER=user
HTACCESS_PASSWORD=password
@fostergn
fostergn / links.css
Created March 7, 2019 19:40
Hover Styles
@fostergn
fostergn / index.html
Created March 7, 2019 19:57
Complex Hover
<style>
.project__container {
transition: box-shadow .3s;
background-color: rgba(0, 0, 255, .8);
color: #fff;
display: inline-block;
padding: 10px;
box-shadow: 6px 11px 28px -8px rgba(0,0,0,0);
}