bobby
bobby
Reputation Top 1%
Bobby Kozora
29 Snippets  (17th place)
Published
1 Channel
Created
5 Channels
Following
Jan 11, 2017
Last Visit
Jan 10, 2017
Registered
646 points  (45th place)
Reputation
Top 5% Publisher
Junior Code Generator
Serious Code Generator
Senior Code Generator
Senior Publisher
Senior Popular Coder
Master Popular Coder
Junior Autobiographer
Senior Autobiographer
Junior Snip2Coder
Junior Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by bobby

public by bobby created Apr 12, 2016  156989  2  4  0

Returns Descriptions for all active Magento products

Returns Descriptions for all active Magento products: Magento-active-product-descriptions.sql
SELECT 
    e.entity_id,
    e.sku,
    eav.value AS 'description',
    IF(at_status.value_id > 0,
        at_status.value,
        at_status_default.value) AS `status`
FROM
    catalog_product_entity e
        JOIN
    catalog_product_entity_text eav ON e.entity_id = eav.entity_id
        JOIN
    eav_attribute ea ON eav.attribute_id = ea.attribute_id
        INNER JOIN
    `catalog_product_entity_int` AS `at_status_default` ON (`at_status_default`.`entity_id` = `e`.`entity_id`)
        AND (`at_status_default`.`attribute_id` = '89')
        AND `at_status_default`.`store_id` = 0
        LEFT JOIN
    `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`)
        AND (`at_status`.`attribute_id` = '89')
        AND (`at_status`.`store_id` = 1)
WHERE
    ea.attribute_code = 'description'
        AND IF(at_status.value_id > 0,
        at_status.value,
        at_status_default.value) = 1
LIMIT 9999

            
;

public by Bobby Kozora created Oct 21, 2016  918  0  3  0

Outlook Email UL Fix

Outlook Email UL Fix: outlook-ul-fix.html
<!--[if gte mso 9]>
<style>
.fixed-ul li {
    text-indent: -1em; /* Normalise space between bullets and text */
}
</style>
<![endif]-->

<!-- -->

<ul style=" margin:0px 0px 0px 15px; list-style:disc; padding-left: 0px;" class="fixed-ul">
  <li style=" margin: 0 px; padding: 0px; color: #f17a21;">...</li>
</ul>


;

public by Bobby Kozora created Sep 28, 2016  668  0  3  0

Split hostname from top level domain

Split hostname from top level domain: regex-split-hostname-tld.txt
/([a-z]{1,})(\.)([a-z.]{1,})/g

;

public by misterebs created Sep 25, 2016  911  0  3  0

Custom font

Custom font: CustomFonts.php
add_action( 'wp_enqueue_scripts', 'custom_google_fonts' );
function custom_google_fonts() {
wp_enqueue_style( 'custom-font', "//fonts.googleapis.com/css?family=Roboto:400,300,100,500");
}

To include multiple fonts at once, add the | separator, like so

wp_enqueue_style( 'custom-font', "//fonts.googleapis.com/css?family=Roboto:400,300,100,500|Roboto+Slab:400,300,100,500");

;

public by bobby created Apr 13, 2016  847  0  4  0

Magento - Retrieve DB Info from local.xml

Magento - Retrieve DB Info from local.xml: magento-retrieve-db-info.php
<?php

//  Bootstrap Magento
require_once("../www/app/Mage.php");
$app = Mage::app('default');

//  Grab our database config info
$config = Mage::getConfig()->getResourceConnectionConfig("default_setup");

//  Connect to our RDS MySQL instance
$mysqli = new mysqli($config->host, $config->username, $config->password, $config->dbname);

//  check RDS MySQL connection
if ($mysqli->connect_errno) {
    printf("Connect failed: %s\n", $mysqli->connect_error);
    exit();
}


;