Here is a simple plugin with no config and it runs on a single lifecycle event postBuild
// Plugin code |
const Account = require("../models/account") | |
module.exports = (handler) => async (event, context) => { | |
let auth = event.headers.authorization | |
auth = auth.replace(/^Basic\s/, "") | |
auth = Buffer.from(auth, 'base64').toString() | |
const [id, token] = auth.split(":") | |
const account = await Account.get({ id }) |
const crypto = require("crypto") | |
const querystring = require("querystring") | |
const fetch = require("isomorphic-fetch") | |
const Account = require("./models/account") | |
exports.handler = async (event, context) => { | |
const { shop, hmac, code, timestamp } = event.queryStringParameters | |
const apiKey = process.env.SHOPIFY_API_KEY | |
const apiSecret = process.env.SHOPIFY_API_SECRET |
exports.handler = async (event, context) => { | |
const shop = event.queryStringParameters.shop | |
const redirectUri = event.queryStringParameters.redirect | |
const apiKey = process.env.SHOPIFY_API_KEY | |
const scopes="read_content,write_content,read_products,read_themes,write_themes" | |
if (shop) { | |
const installUrl = 'https://' + shop + | |
'/admin/oauth/authorize?client_id=' + apiKey + | |
'&scope=' + scopes + |
const axios = require('axios') | |
const fs = require('fs') | |
const netrc = require('netrc') | |
const os = require('os') | |
const path = require('path') | |
const host = 'api.storyblok.com' | |
const args = process.argv | |
let space = '' | |
args.forEach((arg) => { |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
["✌","😂","😝","😁","😱","👉","🙌","🍻","🔥","🌈","☀","🎈","🌹","💄","🎀","⚽","🎾","🏁","😡","👿","🐻","🐶","🐬","🐟","🍀","👀","🚗","🍎","💝","💙","👌","❤","😍","😉","😓","😳","💪","💩","🍸","🔑","💖","🌟","🎉","🌺","🎶","👠","🏈","⚾","🏆","👽","💀","🐵","🐮","🐩","🐎","💣","👃","👂","🍓","💘","💜","👊","💋","😘","😜","😵","🙏","👋","🚽","💃","💎","🚀","🌙","🎁","⛄","🌊","⛵","🏀","🎱","💰","👶","👸","🐰","🐷","🐍","🐫","🔫","👄","🚲","🍉","💛","💚"] |
1. Install ffmpeg: | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
2. Convert: | |
ffmpeg -i input-file.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output-file.webm |
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |