Skip to content

Instantly share code, notes, and snippets.

@galou
galou / install_adobe_digital_editions.sh
Created Jan 14, 2020
How-To install Adobe Digital Editions 4.5 on Ubuntu 18.04
View install_adobe_digital_editions.sh
#!/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
@milkbottlelough
milkbottlelough / product-thumnail.liquid
Created Dec 11, 2019
Shopify - Show a percentage discount "on sale" button
View product-thumnail.liquid
...
...
{%- 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 %}
...
@eksiscloud
eksiscloud / wget
Last active Mar 19, 2021
Warm up of reverse proxy like Varnish using wget
View 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)
@travelhawk
travelhawk / ffmpeg_commands.md
Last active Jun 26, 2022
Collection of ffmpeg commands (basic usage, streaming, advanced usage)
View ffmpeg_commands.md

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
View cannibalization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eksiscloud
eksiscloud / functions.php
Created Oct 28, 2019
Wordpress: Use Amazon SES with PHPMailer
View functions.php
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
@eksiscloud
eksiscloud / wp-plugins.sh
Last active Mar 19, 2021
WP CLI + Bash: Batch installer of Wordpress plugins
View wp-plugins.sh
#!/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
@stvnrynlds
stvnrynlds / menus-api.liquid
Last active Jan 19, 2022
Shopify LinkList API Workaround
View menus-api.liquid
{%- 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 }}",
View theme-js-gtm-checkout.liquid
{%- 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 || [];
@siliconvallaeys
siliconvallaeys / Ad Text N-Grams
Last active Aug 10, 2022
Get an n-gram analysis of Google Ads ad texts
View Ad Text N-Grams
/**
*
* 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