Skip to content

Instantly share code, notes, and snippets.

@siliconvallaeys
siliconvallaeys / Ad Text N-Grams
Last active March 5, 2023 13:25
Get an n-gram analysis of Google Ads ad texts
/**
*
* Ad Text N-Gram Mining Tool
*
* Get aggregated metrics for when the same word sequence is used in ads across your account.
* Discover better performing phrases from all your Google Ads.
*
* Based on a script by Daniel Gilbert and BrainLabsDigital.com (https://searchengineland.com/brainlabs-script-find-best-worst-search-queries-using-n-grams-228379)
*
* Adapted by Fred Vallaeys and Optmyzr.com to work with expanded ad text rather than search terms data
{%- comment -%}
Google Tag Manager scripts for checkout.liquid
Note: This script must run after {{ checkout_scripts }}
{%- endcomment -%}
{% assign order_data = checkout.order %}
{% assign customer_data = checkout.customer %}
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
@stvnrynlds
stvnrynlds / menus-api.liquid
Last active January 19, 2022 14:46
Shopify LinkList API Workaround
{%- layout none -%}
{%- assign listParams = request.path | replace: page.url, "" | remove: "/" | split: '+' -%}
{% if listParams != empty %}
{
{% for param in listParams -%}
{%- assign getList = linklists[param] -%}
{%- if getList != empty %}
"{{ param }}": [{% for level1 in getList.links %}{
"id": "{{ level1.title | handle }}-{{ forloop.index0 }}",
@eksiscloud
eksiscloud / wp-plugins.sh
Last active March 19, 2021 12:06
WP CLI + Bash: Batch installer of Wordpress plugins
#!/usr/bin/env bash
## WordPress Plugin Installer using BASH and WP-CLI
# Make executable: chmod u+x wp-plugins
# remember change WPPATH
# array of plugin slugs to install
WPPLUGINS=(
advanced-database-cleaner basepress categorytinymce classic-editor code-snippets change-last-modified-date disqus-comment-system
@eksiscloud
eksiscloud / functions.php
Created October 28, 2019 09:13
Wordpress: Use Amazon SES with PHPMailer
add_action( 'phpmailer_init', 'set_phpmailer_details' );
function set_phpmailer_details( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'SMTP_endpoint'; //Amazon SES SMTP endpoint for your region
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = 'Amazon_SES_USERNAME';
$phpmailer->Password = 'Amazon_SES_PASSWORD';
$phpmailer->SMTPSecure = 'tls';
$phpmailer->From = get_option('admin_email'); //your verified email address
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@travelhawk
travelhawk / ffmpeg_commands.md
Last active April 2, 2024 16:23
Collection of ffmpeg commands (basic usage, streaming, advanced usage)

ffmpeg

ffmpeg is a fast video and audio converter that can also grab from a live audio/video source.

Standard usage

Getting help and information

  • -h show all options
  • -h(elp) topic show help
  • -version show version
  • -formats show available formats
@eksiscloud
eksiscloud / wget
Last active March 19, 2021 12:03
Warm up of reverse proxy like Varnish using wget
wget --spider -o wget.log -e robots=off -r -l 5 -p -S -T3 --header="X-Bypass-Cache: 1" -H --domains=example.tld --show-progress www.example.tld
# Options explained
# --spider: Crawl the site
# -o wget.log: Keep the log
# -e robots=off: Ignore robots.txt
# -r: specify recursive download
# -l 5: Depth to search. I.e 1 means 'crawl the homepages'. 2 means 'crawl the homepage and all pages it links to'...
# -p: get all images, etc. needed to display HTML page
# -S: print server response (to the log)
@milkbottlelough
milkbottlelough / product-thumnail.liquid
Created December 11, 2019 14:08
Shopify - Show a percentage discount "on sale" button
...
...
{%- assign percentageDiscount = product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0' -%}
{% if product.compare_at_price_max > product.price %}
<div class="sale-banner"><span>{{ 'collections.general.sale' | t }}</span><p>{{percentageDiscount}}%<span>OFF!</span></div>
{% endif %}
...
@galou
galou / install_adobe_digital_editions.sh
Created January 14, 2020 19:34
How-To install Adobe Digital Editions 4.5 on Ubuntu 18.04
#!/bin/sh
# Preliminary conditions:
# Ubuntu 18.04
# sudo apt install winbind playonlinux
# Add wine 4.21 32 bit to PlayOnLinux through the GUI.
# Download ADE_4.5_Installer.exe to /tmp.
WINEPREFIX=$HOME/.PlayOnLinux/wineprefix/AdobeDigitalEditions45
WINEARCH=win32
WINE=$HOME/.PlayOnLinux/wine/linux-x86/4.21/bin/wine