Skip to content

Instantly share code, notes, and snippets.

View markbain's full-sized avatar
🎯
Focusing

Mark Bain markbain

🎯
Focusing
View GitHub Profile
@markbain
markbain / related-shortcodes.md
Last active October 31, 2023 11:22
KF 21 shortcodes
__ __ __ __
\ V\ V\ V / v3.9.1 Path:"/home/mark/code/vvv"
\_/\_/\_/ git::master(8b46bc24)
Platform: linux shell:/usr/bin/zsh systemd vagrant-goodhosts CaseSensitiveFS shared_db_folder_disabled
Vagrant: v2.3.4, virtualbox: v5.2.42
Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard: http://vvv.test
@markbain
markbain / paths.php
Last active May 6, 2020 13:33
Get the full path to a dir
<?php
$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
echo $_SERVER['DOCUMENT_ROOT'];
?>
@markbain
markbain / wp-permissions
Created May 6, 2020 13:32
Configure WP permissions script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@markbain
markbain / index.html
Created May 6, 2020 13:08
Coming soon page - Simple HTML page
<!DOCTYPE HTML>
<html>
<head>
<title>www.example.com &mdash; Coming Soon!</title>
<!-- START META TAG SECTION -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="Content-Language" content="en">
@markbain
markbain / aos-custom.js
Last active September 5, 2019 16:40
AOS animations #js #javascript
jQuery( document ).ready( function( $ ) {
/**
* Animations
*/
// See https://github.com/michalsnik/aos
AOS.init();
@markbain
markbain / woo-pages.md
Last active April 2, 2019 10:00
Woocommerce pages for styling

NOTE: If you are using custom endpoints, these paths will change

Address

  • /account/edit-addresses/
  • /account/edit-addresses/billing/
  • /account/edit-addresses/shipping/
@markbain
markbain / tasks.sh
Last active December 21, 2018 17:59
ConEmu example
>"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -cur_console:n -cur_console:d:"e:\Mark Bain Design\dev\vvv\Three\VVV\www\makingmusic" -cur_console:P:"^<Solarized ^(John Doe^)^>" -cur_console:t:"Make Music"
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -cur_console:s1TVn -cur_console:d:"e:\Mark Bain Design\dev\vvv\Three\VVV\www\makingmusic" -cur_console:P:"^<Solarized ^(Luke Maciak^)^>"
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -cur_console:s1THn -cur_console:d:"e:\Mark Bain Design\dev\vvv\Three\VVV\www\makingmusic" -cur_console:P:"^<Solarized ^(Luke Maciak^)^>"
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i -cur_console:s2THn -cur_console:d:"e:\Mark Bain Design\dev\vvv\Three\VVV\www\makingmusic\public_html\wp-content" -cur_console:P:"^<Twilight^>"
@markbain
markbain / woocommerce-availabilty.php
Created November 9, 2018 16:20
Woocommerce custom availability #wordpress #woocommerce
add_filter( 'woocommerce_get_availability', 'custom_get_availability', 1, 2);
function custom_get_availability( $availability, $_product ) {
global $product;
$stock = $product->get_total_stock();
if ( $_product->is_in_stock() ) $availability['availability'] = __($stock . ' places remaining', 'woocommerce');
if ( !$_product->is_in_stock() ) $availability['availability'] = __('SOLD OUT', 'woocommerce');
return $availability;
@markbain
markbain / archive-meta-sort.php
Created November 9, 2018 16:16
Order archive by meta #wordpress
/**
* Order person achive results A-Z by last name
*/
function baindesign324_reorder_posts_person( $query ) {
if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'cpt1' ) {
$query->set('orderby', 'meta_value');
$query->set('meta_key', 'last_name');
$query->set('order', 'ASC');
}
}