This document helps get your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, and MariaDB.
<?php | |
/** | |
* List available attributes on product page in a drop-down selection | |
*/ | |
add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page'); | |
function list_attributes_on_product_page() { | |
global $product; | |
$attributes = $product->get_attributes(); |
<?php | |
/** | |
* @param WP_Query|null $wp_query | |
* @param bool $echo | |
* @param array $params | |
* | |
* @return string|null | |
* | |
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507 | |
* |
#!/bin/bash | |
# Creator: Phil Cook | |
# Modified: Andy Miller | |
# | |
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh | |
# >>> Kept here for legacy purposes | |
# | |
osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) |
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response | |
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then | |
wp @development db reset --yes && | |
wp @production db export - > sql-dump-production.sql && | |
wp @development db import sql-dump-production.sql && | |
wp @development search-replace https://example.com https://example.dev | |
fi |
#!/bin/bash | |
# Check if command was ran as root. | |
if [[ $(id -u) -eq 0 ]]; then | |
echo "The command \"sphp\" should not be executed as root or via sudo directly." | |
echo "When a service requires root access, you will be prompted for a password as needed." | |
exit 1 | |
fi | |
# Usage |
#!/usr/bin/env python | |
""" | |
This script can be used to get a per-author RSS feed on iMore.com. It will try to | |
cache the entries, so the last 40 entries from an author will show up, even if | |
they're no longer in the main feed. | |
To invoke, just call this script at the command line: | |
python settern_rss.py | |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
// see also https://github.com/robmorgan/phinx/issues/364 | |
$phinxApp = new \Phinx\Console\PhinxApplication(); | |
$phinxTextWrapper = new \Phinx\Wrapper\TextWrapper($phinxApp); | |
$phinxTextWrapper->setOption('configuration', '/path/to/phinx.yml'); | |
$phinxTextWrapper->setOption('parser', 'YAML'); | |
$phinxTextWrapper->setOption('environment', 'development'); |
/* rewritten bootstrap 3 responsive timeline css for less | |
* source: http://bootsnipp.com/snippets/featured/timeline-responsive | |
*/ | |
.timeline { | |
list-style: none; | |
padding: 20px 0 20px; | |
position: relative; | |
&:before { | |
top: 0; | |
bottom: 0; |