Skip to content

Instantly share code, notes, and snippets.

View skolhustick's full-sized avatar

eshwarenm skolhustick

View GitHub Profile
@skolhustick
skolhustick / metatags.html
Created February 15, 2020 10:05
next-js-pwa-metatags
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' />
<meta name='description' content='Description' />
<meta name='keywords' content='Keywords' />
<title>Next.js PWA Example</title>
<link rel="manifest" href="/manifest.json" />
<link href='/favicon-16x16.png' rel='icon' type='image/png' sizes='16x16' />
<link href='/favicon-32x32.png' rel='icon' type='image/png' sizes='32x32' />
@skolhustick
skolhustick / next.config.js
Created February 15, 2020 07:50
next-js-pwa-setup
const withPWA = require('next-pwa')
module.exports = withPWA({
pwa: {
dest: 'public'
}
})
name: Node.js CI
on: [push]
jobs:
build:
runs-on: self-hosted
strategy:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
#ONE FOR EACH NEXTJS APP AND SUBDOMAIN
#BIKES - PORT 3001
const stripe = require("stripe")("sk_test_SXIuQ6FMks5aBKEOZCvEJn2k");
const subscribeCustomerToPlan = async (customerId, planId) => {
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{plan: planId}],
});
console.log(subscription);
return subscription;
}
const createCustomer = async () => {
const CUSTOMER_EMAIl = "[email protected]";
const CUSTOMER_SOURCE = 'tok_mastercard';
const customer = await stripe.customers.create({
email: CUSTOMER_EMAIl,
source: CUSTOMER_SOURCE,
});
console.log(customer);
return customer.id;
const createPlan = async productId => {
const PLAN_NICKNAME = "Monthly Subscription Plan";
const PLAN_INTERVAL = "month";
const CURRENCY = "usd";
const PLAN_PRICE = 200;
const plan = await stripe.plans.create({
product: productId,
nickname: PLAN_NICKNAME,
currency: CURRENCY,
const createProduct = async () => {
const PRODUCT_NAME = "Monthly Subscription";
const PRODUCT_TYPE = 'service'
const product = await stripe.products.create({
name: PRODUCT_NAME,
type: PRODUCT_TYPE,
});
console.log(product);
<h1>{{title}}</h1>
<p>Welcome to {{title}}</p>
{{#is someVariable 'example'}}
THIS WILL BE RENDERED
{{/is}}