Skip to content

Instantly share code, notes, and snippets.

View ardeearam's full-sized avatar
💭
https://blog.klaudsol.com

Ardee Aram ardeearam

💭
https://blog.klaudsol.com
View GitHub Profile
@ardeearam
ardeearam / GoogleLogin.js
Created January 25, 2021 04:05
lib/GoogleLogin.js
export const loadGoogleScript = () => {
//loads the Google JavaScript Library
(function () {
const id = 'google-js';
const src = 'https://apis.google.com/js/platform.js';
//we have at least one script (React)
const firstJs = document.getElementsByTagName('script')[0];
cd /home/ubuntu/code
git clone git@github.com:klaudsol/shopify-app-under-20-minutes.git app1
chmod +x /home/ubuntu/code/app1/entrypoint.sh
docker-compose up -d
docker-compose logs -f
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
docker run hello-world
#!/bin/sh
npm run-script build
npm start
@ardeearam
ardeearam / get-one-time-url.js
Created July 13, 2020 03:08
Get One Time URL
export function ONETIME_CREATE(url) {
return gql`
mutation {
appPurchaseOneTimeCreate(
name: "test"
price: { amount: 10, currencyCode: USD }
returnUrl: '${url}'
test: true
) {
userErrors {
@ardeearam
ardeearam / get-subscription-url.js
Last active July 13, 2020 04:10
Modify subscription price and frequency
export function RECURRING_CREATE(url) {
return gql`
mutation {
appSubscriptionCreate(
name: "Super Duper Plan"
returnUrl: "${url}"
test: true,
trialDays: 7,
lineItems: [
{
@ardeearam
ardeearam / shopify-auth-after-billing.js
Created July 13, 2020 02:42
Shopify Auth - After Billing Code
server.use(
createShopifyAuth({
apiKey: SHOPIFY_API_KEY,
secret: SHOPIFY_API_SECRET,
scopes: [SCOPES],
async afterAuth(ctx) {
//Auth token and shop available in session
//Redirect to shop upon auth
const { shop, accessToken } = ctx.session;