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; | |
}); |
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; |
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 |
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 |
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 |
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 |
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 |
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 |
NewerOlder