Skip to content

Instantly share code, notes, and snippets.

@ChromeOrange
ChromeOrange / gist:7955195
Created December 14, 2013 02:55
Move WooCommerce Related Products to a tab
/**
* Move WooCommerce Related Products to a tab
*
* Copy code to theme functions.php
*/
// Remove standard Related Products section
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
/**
@artikus11
artikus11 / snippet-woo.php
Created December 10, 2022 23:04
Подключение скриптов и стилей только на страницах WooCommerce
/**
* Подключение скриптов и стилей только на страницах WooCommerce
*
* @testedwith WooCommerce 7.0
* @verphp 7.4
* @author Artem Abramovich
*/
function art_connection_css_js_only_woocommerce_pages() {
if ( ! class_exists( 'Woocommerce' ) ) {
const notice = (msg) => new Notice(msg, 5000);
const log = (msg) => console.log(msg);
const parser = new DOMParser();
const API_URL = "https://api.geekdo.com/xmlapi2";
module.exports = {
entry: start,
settings: {
name: "BoardGameGeek",
@tuongpgjz
tuongpgjz / functions.php
Created January 1, 2022 13:38
Replace woocommerce product tab with new one
<?php
//SalesGen.io
//remove reviews and additional_information tab
add_filter( 'woocommerce_product_tabs', 'salesgen_remove_product_tabs', 98 );
function salesgen_remove_product_tabs( $tabs ) {
if(is_product()){
unset( $tabs['additional_information'] ); // Remove the additional information tab
unset( $tabs['reviews'] ); // Remove the additional information tab
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 8, 2024 15:08
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 15:08
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 8, 2024 15:08
set -e, -u, -o, -x pipefail explanation
@danbri
danbri / README.md
Last active May 8, 2024 15:07 — forked from fabiovalse/README.md
Schema.org hierarchy Sunburst
@SteveDaulton
SteveDaulton / pipeclient.py
Last active May 8, 2024 15:07
pipeclient.py is a Python module for sending commands to Audacity from Python. This version is more recent than Audacity's version.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Automate Audacity via mod-script-pipe.
Pipe Client may be used as a command-line script to send commands to
Audacity via the mod-script-pipe interface, or loaded as a module.
Requires Python 3.
(Python 2.7 is now obsolete, so no longer supported)
@gstricklind
gstricklind / functions.php
Last active May 8, 2024 15:07
Product Reviews Shortcode - only works on single-product template
/*========================================================================
3 Column Reviews shortcode - can only be used on single product pages
https://ginastricklind.com/how-to-create-a-product-reviews-shortcode-query/
========================================================================*/
add_shortcode( 'display_latest_reviews', 'gs_display_latest_reviews' );
function gs_display_latest_reviews() {
if( is_product() ) {
global $product;
$id = $product->id;