Skip to content

Instantly share code, notes, and snippets.

Avatar
😍

Rob Conery robconery

😍
View GitHub Profile
View index.js
const functions = require('firebase-functions');
const stripe = require("./lib/stripe");
exports.createCheckoutSession = functions.https.onCall(async (data, context) => {
console.log("Checkout session request incoming", data);
const res = await stripe.createSubscriptionCheckout(data);
return res;
});
@robconery
robconery / jsonb.js
Last active Nov 11, 2020
A Simple JSONB Module for Node
View jsonb.js
const runner = require("./runner");
const transformRecord = function(record) {
if (record) {
const doc = record.doc;
doc.createdAt = record.created_at;
doc.id = record.id;
return doc;
} else {
return null;
@robconery
robconery / ghost_azure.sh
Created Apr 10, 2019
Create a complete Ghost Website on Azure with Domain Assignment
View ghost_azure.sh
RG="BLOG"
APPNAME="conery-ghost"
IMAGE=ghost
DOMAIN="ghost.conery.io"
DB_USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
DB_PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
DB_SERVERNAME=server$RANDOM
#You can get a list of locations by running
#az account list-locations --query [].name
View firebase_make.sh
tag:
git tag -l "deploy-$(date +%Y-%m-%d-%T)"
commit:
git commit -am "Deploying $(date +%Y-%m-%d-%T)"
build:
bundle exec middleman build
deploy: build commit tag
@robconery
robconery / azure_ghost.sh
Last active Jan 28, 2020
Deploy Ghost to Azure Services
View azure_ghost.sh
RG="azx"
APPNAME=$RG-ghost
LOCATION="Central US"
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
@robconery
robconery / azure_wordpress.sh
Last active Aug 24, 2020
Spin up Wordpress on Azure Using Managed Services
View azure_wordpress.sh
RG="[YOUR RESOURCE GROUP]"
APPNAME=$RG-wordpress #Name what you want
LOCATION="Central US" #put where you like
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
#accepted values for the service plan: B1, B2, B3, D1, F1, FREE, P1, P1V2, P2, P2V2, P3, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED
@robconery
robconery / azure_postgresql_deploy.sh
Created Oct 1, 2018
Deployment script for Azure PostgreSQL
View azure_postgresql_deploy.sh
#!/bin/bash
#These are the settings for deployment. The only thing you need to be sure you change is
#the resource group, as that will be the name you will use to destroy things later
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
LOCATION=westus
SERVERNAME=northwind-$RANDOM #this has to be unique across azure
#resource group
@robconery
robconery / azure_postgres_tryout.sh
Created Sep 14, 2018
Spin up an Azure PostgreSQL database
View azure_postgres_tryout.sh
#!/bin/bash
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=[YOUR SERVER NAME] #this has to be unique across azure
#resource group
RG=[YOUR RESOURCE GROUP] #you can create these if you need to by uncommenting the lines below
View azure_webapp_setup.sh
#!/bin/bash
USER=deployer
PASS=[pick something]
APPNAME=[your app name]
RG=[your resource group]
SP=[your service plan]
#you can see a list of runtimes using
#az webapp list-runtimes --linux
@robconery
robconery / register.sql
Created Dec 29, 2017
A PLPGSQL Register Function
View register.sql
CREATE OR REPLACE FUNCTION register(login varchar(50), email varchar(50), password varchar(50), ip inet)
returns TABLE (
new_id bigint,
message varchar(255),
email varchar(255),
email_validation_token varchar(36)
)
AS
$$
DECLARE
You can’t perform that action at this time.