working on it ...

Filters

Explore Public Snippets

Sort by

Found 29 snippets

    public by bobby  157351  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  2322  0  4  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  945  2  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  1180  1  4  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  1092  0  5  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();
    }
    
    
    

    public by Bobby Kozora  506  1  3  0

    Display Magento Backtrace

    Display Magento Backtrace: magento-backtrace.php
    <?php
    
    Mage::log(Varien_Debug::backtrace(true, true), null, 'backtrace.log');
    
    

    public by bkozora  552  0  3  0

    Email File as Attachment from Command Line

    Email File as Attachment from Command Line: email-file.sh
    ( cat file.txt; ux2dos file.txt | uuencode file.txt file.txt ) | mailx -m -s "subject" -r email@address email@address
    
    

    public by Bobby Kozora  38186  1  3  0

    Retrieve Magento Database Configuration

    Retrieve Magento Database Configuration: magento-database-config.php
    <?php
    
    require_once ("../app/Mage.php");
    $app = Mage::app('default');
    
    $config  = Mage::getConfig()->getResourceConnectionConfig("default_setup");
    
    $dbinfo = array(
      "host"    => $config->host,
      "user"    => $config->username,
      "pass"    => $config->password,
      "dbname"  => $config->dbname
    );
    
    
    

    public by bobby  607  2  3  0

    Magento - Grab Orphaned Enabled Products

    Magento - Grab Orphaned Enabled Products : magento-orphaned-enabled-products.sql
    SELECT 
        *
    FROM
        catalog_product_entity a
            LEFT JOIN
        catalog_product_entity_int ei ON ei.entity_id = a.entity_id
            LEFT JOIN
        catalog_category_product cp ON cp.`product_id` = a.entity_id
            LEFT JOIN
        catalog_product_relation cpr ON cpr.child_id = a.entity_id
    WHERE
        cp.product_id IS NULL
            AND cpr.parent_id IS NULL
            AND a.type_id != 'configurable'
            AND ei.attribute_id = 89
            AND ei.value = 1
            /*
            AND attribute_id = (SELECT 
                attribute_id
            FROM
                `eav_attribute`
            WHERE
                `attribute_code` LIKE 'status')
            AND `ei`.`value` = 1
            */
    
    

    public by bobby  920  1  3  0

    Test server's download connection speed from terminal: From http://lifehacker.com/how-to-test-your-internet-speed-with-a-terminal-command-1364123567

    Test server's download connection speed from terminal: From http://lifehacker.com/how-to-test-your-internet-speed-with-a-terminal-command-1364123567: new_gist_file_0
    time wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
    
    
    • Public Snippets
    • Channels Snippets