Skip to content

Instantly share code, notes, and snippets.

@skillmatic-co
skillmatic-co / Much much simpler option selector for Shopify
Last active November 25, 2021 18:49 — forked from zakhardage/Much much simpler option selector for Shopify
Much simpler version of Shopify's option_selection.js for separating product options into their own dropdown menus.
<form action="/cart/add" method="post">
{% if product.variants.size > 1 %}
{% if product.options[0] %}
<label for="select-one">{{ product.options[0] }}</label>
<select id="select-one" onchange="letsDoThis()">
{% for value in product.options_with_values[0].values %}
<option value="{{ value }}" {% if product.options_with_values[0].selected_value == value %}selected{% endif %}>
{{ value }}
</option>
{% endfor %}
@skillmatic-co
skillmatic-co / mysql-docker.sh
Created October 31, 2019 17:18 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@skillmatic-co
skillmatic-co / gist:2628499769383b3bbbeb24a739544d08
Last active August 22, 2016 14:57 — forked from wpscholar/jquery.external-links-new-window.js
Open all external links in a new window
$('article.post .entry-content a').not('[href*="mailto:"]').each(function () {
var isInternalLink = new RegExp('/' + window.location.host + '/');
if ( ! isInternalLink.test(this.href) ) {
$(this).attr('target', '_blank');
}
});
@skillmatic-co
skillmatic-co / .gitignore
Created November 5, 2015 20:15 — forked from salcode/.gitignore
WordPress .gitignore - this is my preferred gitignore file when working with WordPress. It ignores almost all files by default.
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20150227
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.