This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Location: Anywhere | |
# Add existing 'ubuntu' user to 'www-data' group | |
sudo usermod -a -G www-data ubuntu; | |
# Set the ownership of the files/directories | |
sudo chown -R www-data:www-data /var/www/html/; | |
# Set group ownership inheritance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this code to your theme functions.php file or a custom plugin | |
add_action('init', 'register_order_status'); | |
//add status after completed | |
add_filter('wc_order_statuses', 'add_delivered_to_order_statuses'); | |
//Custom Statuses in admin reports | |
add_filter('woocommerce_reports_order_statuses', 'include_custom_order_status_to_reports', 20, 1); | |
// for automate woo to check order is paid | |
add_filter('woocommerce_order_is_paid_statuses', 'delivered_woocommerce_order_is_paid_statuses'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz | |
tar xfvz mysql-5.7* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Acme; | |
/** | |
* Class FooBar | |
* | |
* @link http://anomaly.is/foo-bar | |
* @author AnomalyLabs, Inc. <[email protected]> | |
* @author Ryan Thompson <[email protected]> | |
* @package Acme | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.row { | |
max-width: none; | |
width: 960px; /* any width you want */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$product=Mage::getModel("catalog/product"); | |
$prod=$product->load($_product->getId()); | |
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($prod); | |
$col = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions(); | |
$total_qty=0; | |
foreach($col as $sprod){ | |
$sprod=$product->load($sprod->getId()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cleanup.php?clean=var | |
// cleanup.php?clean=log | |
$xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA); | |
$db['host'] = $xml->global->resources->default_setup->connection->host; | |
$db['name'] = $xml->global->resources->default_setup->connection->dbname; | |
$db['user'] = $xml->global->resources->default_setup->connection->username; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gistPrefix = 'http://gist.github.com/', | |
// Cache document.write so that it can be restored once all Gists have been | |
// embedded. | |
cachedWrite = document.write, | |
body = $('body'), | |
// Map each p.gist to an object that contains the paragraph to be replaced | |
// and the Gist's identifier. | |
gists = $('p.gist').map(function(n, p) { | |
p = $(p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists('product_post_type') ) { | |
// Register Custom Post Type | |
function product_post_type() { | |
$labels = array( | |
'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( 'Product', 'text_domain' ), | |
'parent_item_colon' => __( 'Parent Product:', 'text_domain' ), |