Skip to content

Instantly share code, notes, and snippets.

@alphasider
alphasider / woo_add_product_programmatically.php
Created September 21, 2020 11:23
Add woocommerce product programmaticaly (with attributes)
<?php
/**
* SOURCE: https://stackoverflow.com/questions/52937409/create-programmatically-a-product-using-crud-methods-in-woocommerce-3
*/
/* THE CODE FUNCTION */
// Custom function for product creation (For Woocommerce 3+ only)
function create_product( $args ){
global $woocommerce;
@andrewgodwin
andrewgodwin / QuakeTerminal.ahk
Created February 15, 2020 17:41
AutoHotkey script for making Windows Terminal appear/disappear with a single keypress
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F12::ToggleTerminal()
ShowAndPositionTerminal()
{
WinShow ahk_class CASCADIA_HOSTING_WINDOW_CLASS
@craigedmonds
craigedmonds / gist:e750c6734b8bec47ca04b4d209b5f5f2
Created August 27, 2019 10:56
Get a list of field names and values from an ACF Group
<?php
########################
// GET FIELD NAMES AND VALUES FROM ACF GROUP
//
// created by craig@jucra.com on 27/8/2019
//
// This script will do the following:
// 1. Loop through the fields in a specific ACF Group
// 2. Create an array called $array_of_field_names
// so you can easily print out a list of the field names
@bradtraversy
bradtraversy / docker_wordpress.md
Last active May 4, 2024 09:16
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@passcod
passcod / __why-and-how-to-use.md
Last active March 22, 2023 13:33
Bootstrap 4 mixins for spacing utilities without classes

Why?

This:

.action {
  @extend .ml-3;
}
@bradtraversy
bradtraversy / docker-help.md
Last active April 30, 2024 17:28
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@MSerj
MSerj / multiple_swiper.js
Last active July 27, 2022 16:07
Multiple Instances of Swiper on Same page
if ($('.swiper-container').length > 0) { //some-slider-wrap-in
let swiperInstances = [];
$(".swiper-container").each(function(index, element){ //some-slider-wrap-in
const $this = $(this);
$this.addClass("instance-" + index); //instance need to be unique (ex: some-slider)
$this.parent().find(".swiper-pagination").addClass("pagination-" + index);
$this.parent().find(".swiper-button-prev").addClass("prev-" + index); //prev must be unique (ex: some-slider-prev)
$this.parent().find(".swiper-button-next").addClass("next-" + index); //next must be unique (ex: some-slider-next)
swiperInstances[index] = new Swiper(".instance-" + index, { //instance need to be unique (ex: some-slider)
// your settings ...
@Astargh
Astargh / function.php
Created February 22, 2017 22:41
Quick view woocommerce
wp_enqueue_script( 'my-ajax-request', get_template_directory_uri() . '/js/main.js' );
wp_localize_script( 'my-ajax-request', 'myajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
add_action('wp_ajax_woo_quickview', 'woo_quickview');
add_action('wp_ajax_nopriv_woo_quickview', 'woo_quickview');
function woo_quickview() {
global $post, $product, $woocommerce;
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc