This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i ~/desktop/Icon_alpha/Icon-3.mov -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 0.9 -tag:v hvc1 -q:v 35 -vf "scale=-1:720,premultiply=inplace=1" ~/desktop/boxes-compressed.mov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mov -vf "select=eq(n\,0)" -vframes 1 output.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.mov -c:v libvpx-vp9 -pix_fmt yuva420p output.webm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Data | |
--- | |
otto_placement_name: Pass this to the snippet. The name is provided in the Otto app. | |
{% endcomment %} | |
{% liquid | |
assign otto_image_metafield = shop.metafields.otto-components[otto_placement_name].value | |
assign otto_image_file = shop.metafields.otto-files[otto_placement_name].value | |
assign otto_mobile_image_file_name = otto_placement_name | append: "-mobile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- comment -%} | |
Otto Metafield Data | |
--- | |
Reference for integrating Otto into a theme. | |
{%- endcomment -%} | |
{% comment %} | |
Placement Name | |
--- | |
The placement name is the name provided in the app. Given a placement name, you can reference all of it's data in metafields. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function getElemCoords(elem) { | |
var box = elem.getBoundingClientRect(); | |
var body = document.body; | |
var docEl = document.documentElement; | |
var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop; | |
var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft; | |
var clientTop = docEl.clientTop || body.clientTop || 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function randomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const delay = (ms) => new Promise((r) => setTimeout(r, ms)); | |
export default delay; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------- | |
Imports | |
-----------------------*/ | |
import fs from "fs"; | |
import csv from "csvtojson"; | |
import path from "path"; | |
import { fileURLToPath } from "url"; | |
import { stringify } from "csv"; | |
/*----------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Data | |
const data = []; | |
// Recursive function to call the api in paginated batches. Depending on the api may need a limiter. | |
async function getDataRecursive(page) { | |
// Query for assets at a certain page. | |
const response = await axios.get( | |
`${apiUrl}?page=${page}&limit=250`, | |
{ | |
headers: { |
NewerOlder