Skip to content

Instantly share code, notes, and snippets.

View octipus's full-sized avatar
🎯
Focusing

oContis Studio octipus

🎯
Focusing
View GitHub Profile
@octipus
octipus / combinator.gs
Created January 26, 2023 16:24
Combine multiple Google spreadsheets into one file
//Setup:
// 1. Files must be of type spreadhsheet - not text/csv
// 2. All spreadsheet files must sit in the same G Drive folder
// 3. Get the folder by ID and loop through the files
// 4. Concatenate the results of all files in a separate spreadsheet (outside of the folder)
function myFunction() {
// get the folder ID
var folder = DriveApp.getFolderById("insert-your-folder-id-here")
var filesIterator = folder.getFiles()
@octipus
octipus / gist:cbb2747632e2cff8193ca85dfe6730aa
Created March 23, 2022 17:05 — forked from CodeTheInternet/gist:9312404
JSON with country data, including base64 encoded flag images
[{"id":1,"name":"Afghanistan","isoAlpha2":"AF","isoAlpha3":"AFG","isoNumeric":4,"currency":{"code":"AFN","name":"Afghani","symbol":"؋"},"flag":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAIAAAAVyRqTAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3REQwQzQwNjE3NTMxMUUyODY3Q0FBOTFCQzlGNjlDRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3REQwQzQwNzE3NTMxMUUy
@octipus
octipus / gist:8b9fc7ecd7e2a11baf2400dcc1f61fda
Last active October 27, 2021 13:32
Shopify Themekit quick steps
1. Create a custom app in shopify
2. Get the app secret/password
3. fill in below - !important - Remove brackets
theme get -p=[your-password] -s=[you-store.myshopify.com] -t=[your-theme-id]
4. theme watch
@octipus
octipus / gh-pages-deploy.md
Created October 12, 2021 21:01 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@octipus
octipus / gist:b9acb7707d5f6f2090d1c6fa069b31dd
Last active April 22, 2022 11:49
ffmpeg Single/Batch compression script
### Single File - default compressor - change the CRF value to tweak with size(and quality)
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
### Single FIle - webm compressor
ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 1M target.webm
@octipus
octipus / product_template_alternative
Last active May 12, 2021 13:40 — forked from pherkan/product_template_alternative
Shopify Narrative product page with flex slider
{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign current_variant_sale = false -%}
{% if current_variant.compare_at_price > current_variant.price %}
{%- assign current_variant_sale = true -%}
{% endif %}
<div class="product-template" data-section-id="{{ section.id }}" data-section-type="product-template" data-variant-id="{{ current_variant.id }}" itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="{{ product.title }}">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
@octipus
octipus / Shopify - Free shipping entitlement
Created June 12, 2020 15:35
Shopify Liquid code snipped to calculate and display entitlement for free shipping ---- ideally to be displayed on the cart page - or anywhere :)
//Shopify Liquid code snipped to calculate and display entitlement for free shipping
//ideally to be displayed on the cart page - or anywhere :)
{%- assign freeShippingAmount = 60 | times:100 -%}
{%- assign cartTotalDiff = freeShippingAmount | minus:cart.total_price -%}
{%- if cart.total_price < freeShippingAmount -%}
<h4>Almost there! <br> Add {{ cartTotalDiff | money }} more to your cart for free shipping</h4>
{%- elsif cart.total_price >= freeShippingAmount -%}
<h4> Congratulations! You now have Free Shipping </h4>
@octipus
octipus / theme.js
Created December 24, 2019 13:39
Shopify Script for detecting users location and apply local currency
//to be placed in theme.js or custom.js
//script for redirecting users to use local currency
$.get("https://ipinfo.io/json", function (response) {
//console.log (response.country)
var check = false;
if (response.country === 'GB') {
//console.log("hello UK");
if(!localStorage["check"]) {
window.location.search += '?currency=gbp';
@octipus
octipus / footer.liquid
Last active May 10, 2021 15:02
Catalyst Footer Logo
@octipus
octipus / cart-drawer.liquid
Last active December 24, 2019 11:02
Shopify cart alert notification message
## Shopify cart notification
## Using on Narrative theme add in the cart-drawer.liquid/cart-template.liquid to display an alert in the cart/ before checkout
<div style="padding:10px;">
<h6>
<strong>
<span style="color:#c54245; font-size:20px;">&#33;&#33;&#33;</span>
Orders placed up until 2nd January:
</strong><br>
Please allow for a 10 working day processing time from 3rd January.