Skip to content

Instantly share code, notes, and snippets.

View Melebius's full-sized avatar

Melebius

  • Czechia
  • 22:20 (UTC +02:00)
View GitHub Profile

macOS Catalina Setup: Homebrew + Apache + PHP + MariaDB

This document provides help on getting your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, and MariaDB.

Before we get started we need to make sure XCode Command Line Tools is installed on your system.

$ xcode-select --install

@ouija
ouija / functions.php
Created August 11, 2019 22:49
WooCommerce: Remove checkout field descriptions 'slideUp and hide' animations
<?
// WooCommerce has a stupid function in the ./assets/js/frontent/woocommerce.min.js file that hides/shows the 'description' elements
// for the checkout fields both when there is an onclick event on the document body, and when any field input is clicked.
//
// The offending code for this 'feature' is the following:
// i(document.body).on("click",function(){i(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),i(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),i(".woocommerce-input-wrapper :input").on("keydown",function(e){var o=i(this).parent().find("span.description");if(27===e.which&&o.length&&o.is(":visible"))return o.prop("aria-hidden",!0).slideUp(250),e.preventDefault(),!1}).on("click focus",function(){var e=i(this).parent(),o=e.find("span.description");e.addClass("currentTarget"),i(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),o.length&&o.is(":hidden")&&o.prop("aria-hidd

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.
@sandersch
sandersch / clone_lvm_part.sh
Last active May 18, 2022 16:30
Back up an lvm partition using Clonezilla
# Mount image desintion to /home/partimag as desired
# No wizards from here. Use the Clonezilla command line
# Abort script on any failures, print out commands for debugging
set -e
set -x
# Partition to clone
[ -n "$VG_NAME" ] || VG_NAME="systemvg"
[ -n "$LV_NAME" ] || LV_NAME="rootlv"