Skip to content

Instantly share code, notes, and snippets.

View edmeehan's full-sized avatar
🐅
On the hunt

Ed Meehan edmeehan

🐅
On the hunt
View GitHub Profile
@edmeehan
edmeehan / gallery.liquid
Created April 28, 2025 01:22
Shopify PDP Gallery - Limit to current variant
@edmeehan
edmeehan / banner.css
Created December 10, 2024 19:27
Banner CSS
.container {
width: 550px;
left: 75% !important;
}
.btn {
margin-top: 0px;
background-color: #fdf68d !important;
border: none;
color: #4e3625;
}
@edmeehan
edmeehan / htmlToJSON.js
Last active August 21, 2025 14:19
Node HTML string to Richtext JSON object - Shopify Metafield
import {JSDOM} from 'jsdom'; // npm i jsdom
function htmlToObj(htmlString) {
const newString = htmlString.replace('<br />','\n')
// string hacks for edge cases
// .replace('<small>','')
// .replace('</small>','')
// .replace('<b>','<strong>')
// .replace('</b>','</strong>');
const dom = new JSDOM(newString);
# Ask for folder name
# echo "Enter the folder name:"
# read folder_name
# Create the folder
mkdir "$1"
# Navigate into the folder
cd "$1"
@edmeehan
edmeehan / get_all_accounts.gs
Last active February 20, 2024 18:06
Google Ads Scripts - ads manager get data and update campaigns
/* ------------------- ADD GOOGLE SHEET URL HERE -------------------------------- */
var GoogleSheetURL = "SHEET_URL_HERE";
/* ------------------------------------------------------------------------------ */
var googleSheet, timeStamp = Date.now();
function main() {
googleSheet = connectToGoogleSheet(GoogleSheetURL);
createAccountsList();
}
@edmeehan
edmeehan / Cake_Final_URL.gs
Last active August 17, 2021 09:44
Google Ad Script - add campaign & adgroup custom param keys & values
/* ------------------- ADD GOOGLE SHEET URL HERE -------------------------------- */
var GoogleSheetURL = "ADD_URL_HERE";
var CakeCreativeGoogleSheetURL = "https://docs.google.com/spreadsheets/d/1PDq3JJXrd-os-GzD7UiW8vF3DCHOmlgpWVFqM4GQAZQ/edit#gid=1492232636";
/* ------------------------------------------------------------------------------ */
var cakeCreativeValues, actionListValues;
function main() {
var googleSheet = connectToGoogleSheet(GoogleSheetURL);
cakeCreativeValues = getCakeCreativeValues();
actionListValues = getActionListValues(googleSheet);
@edmeehan
edmeehan / sc_auto_play_next.js
Created August 30, 2019 04:18
Auto play next sound cloud widget
(function(SC){
const scIframes = [...document.querySelectorAll('iframe[src*="soundcloud.com/player"]')],
soundFinished = function(sc){
const index = scIframes.findIndex((item) => item === this);
if(index < scIframes.length) scWidgets[index + 1].play();
};
let scWidgets = scIframes.map((item) => {
const widget = SC.Widget(item);
export default class {
constructor({
elements
}) {
let that = this,
raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;
// set some property values
this.elements = elements;
@edmeehan
edmeehan / apache
Created September 28, 2015 02:23
Ubuntu 14.04, Apache2
service apache2 start/stop/restart
# a2enconf, a2disconf - enable or disable an apache2 configuration file
# a2ensite, a2dissite - enable or disable an apache2 site / virtual host
# a2enmod, a2dismod - enable or disable an apache2 module
# a2query - retrieve runtime configuration from a local Apache 2 HTTP server
# php5enmod, php5dismod - enable or disable an php5 module