Skip to content

Instantly share code, notes, and snippets.

@zoerooney
zoerooney / page-shopify.php
Last active April 3, 2020 12:44
Shopify Collection Embedded in WordPress
<?php
/**
* Template Name: Shopify Collection Demo
*
*/
get_header(); ?>
<div id="primary" class="full-width">
@chrisgrabinski
chrisgrabinski / shopify-auto-currencies-switcher.js
Last active January 16, 2023 20:04
(Shopify) Automatically change a shop's currency based on the customer's geolocation
// Dependencies
// - https://github.com/carolineschnapp/currencies
// Don't change currency if Cookie has been already set
if (Currency.cookie.read() == null) {
jQuery.ajax( {
url: '//freegeoip.net/json/',
type: 'GET',
dataType: 'jsonp',
@zoerooney
zoerooney / page-gallery.php
Last active April 6, 2021 14:29
Gallery page using ACF PRO with a dynamically generated zip file download of all gallery images. More info/ tutorial here: http://zoerooney.com/blog/tutorials/wordpress-gallery-with-automated-zip-file-download/
@oblique63
oblique63 / Vagrantfile
Last active September 4, 2019 10:50
Opencart Vagrantfile (with VQMod and VQGen)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
PORT = 9999
# Ignore this, cli-installation is buggy
AUTO_INSTALL = false
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active July 14, 2024 11:45
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@oblique63
oblique63 / Vagrantfile
Created July 26, 2015 04:07
opencart bootstrap
# -*- mode: ruby -*-
# vi: set ft=ruby :
LOCAL_PORT = 9999
IP_ADDRESS = "192.168.50.4"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
@andreibabor
andreibabor / Wordpress: how insert other js, css files in sage
Last active August 21, 2020 06:23
Wordpress: how insert other js, css files in sage
Important: putem instal asa: bower install Chart.js --save.
sau pasii mai jos:
1.modifam assets/manifest.json iar la linia 22 punem codul
"slick-carousel.js": {
"files": ["../bower_components/slick-carousel/slick/slick.js"],
"main": true
},
"slick-carousel.css": {
"files": ["../bower_components/slick-carousel/slick/slick.css"],
@FranciscoG
FranciscoG / acf_repeater_shortcode.php
Last active April 18, 2024 00:00
An Advanced Custom Fields shortcode that allows to loop through a field with a repeater. This only handles simple cases, it can't handle nested repeater fields
<?php
/**
* ACF Pro repeater field shortcode
*
* I created this shortcode function because it didn't exist and it was being requested by others
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
*
* @attr {string} field - (Required) the name of the field that contains a repeater sub group
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
// Escaping Liquid in SCSS.
//
// Expected output:
// a{
// color: {{ settings.link-color }};
// }
a{
color: #{'{{ settings.link-color }}'};
}
@MarinX
MarinX / ajax-cart.js
Last active November 13, 2021 15:38
Shopify free shipping motivator
function calculateShipping(cart) {
// if total is more than > 50, we have a free shipping
// change me to some number
var FreeShippingPrice = 50;
$(".cart-info").remove();
if (!cart) {
return;
}
var showText = function (text) {