Where the new Ice Cream Sandwich build of dropbox stores files

In the old version of dropbox, you used to be able to long press > download a file.  This has been replaced by “favorite”.

Instead of going to:
/sdcard/dropbox
These files are now stored in:
/sdcard/Android/data/com.dropbox.android/files/scratch

What do you listen to? (podcast edition)

I tend to listen to a decent number of podcasts. Usually while doing the dishes, running, or something or other in the park.  Some are book/comic related and help me keep up to date with what’s coming out and how some books were that I didn’t have time to read.  Others are tech and help me get other opinions on the new libraries or trends.  I’ve found a number of fun libraries/how-tos from listening. Check them out below, what do you listen to?

Tech

Non Tech

* I listen to every episode, others I cherry-pick

Creating a stateless request in Magento

Have you ever wanted to create a stateless request in Magento? Something that doesn’t touch any of Magento’s sessions?  We were having issues with some of the ajax calls on our cart and checkout pages mucking with the user’s cart and had get stateless on these calls.  The issue we were having was our checkout page was loading, then a javascript include was going out and bringing code from a 3rd party relevance engine into our dom, which was in turn calling back an ajax request to our servers.  This issue with this being that at the start of the page load, the checkout session was being set to a certain state.  This state was then being sent through the rest of the page load, and the ajax calls. Unfortunately, by the time the ajax call got back to our server, the session was different in both locations, creating a race condition.  The ajax request usually won, removing the work the full page load had done with trying to process checkout.  The good news was there was nothing in the ajax call that needed to touch the session, it was just some data lookup. So, nix the session part of that call, and our troubles should be over… Magento’s api controller is the only place that implements a stateless request this but its fairly easy to do (after a bit of digging).

As long as Mage_Core_Controller_Varien_Action is a parent in your controller’s hierchy, you are good to go (it probably is).  This class has a const FLAG_NO_START_SESSION which looks promising. Digging into the code a little we see that it controls whether cookies are processed or the session is started:

<?php
...
        if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) {
            $checkCookie = in_array($this->getRequest()->getActionName(), $this->_cookieCheckActions);
            $checkCookie = $checkCookie && !$this->getRequest()->getParam('nocookie', false);
            $cookies = Mage::getSingleton('core/cookie')->get();
            if ($checkCookie && empty($cookies)) {
                $this->setFlag('', self::FLAG_NO_COOKIES_REDIRECT, true);
            }
            Mage::getSingleton('core/session', array('name' => $this->_sessionNamespace))->start();
        }

By adding to the preDispatch() method of our Action or Controller we can toggle this:

<?php
class Ai_AjaxCatalog_Controller_Action extends Mage_Core_Controller_Front_Action
{
        public function preDispatch()
        {
                $this->setFlag('', self::FLAG_NO_START_SESSION, 1); // Do not start standard session
                parent::preDispatch();
                return $this;
        }
}

Now, any action in this controller will be stateless and not effect any sessions.

Jira Tabs: Open all those Jira’s at once!

Ever want to open all the Jira’s on the screen in new tabs? Jess does, I do, and you should too!

For firefox and chrome we now have the JiraTabs bookmark button.

Drag this link up to your bookmarks bar: JiraTabs. Then, whenever you are on a filter or search view of Jira’s, click the button and all the jira’s on your screen will open up in new tabs

Demo:

Any updates will be made here.

Google’s Groupon Competitor Goes Live

http://bit.ly/eFvNwn

Skynet Becomes Self Aware Tonight

Terminator: The Sarah Connor ChroniclesEdit Terminator: The Sarah Connor Chronicles section

As a result of temporal interference by Sarah Connor, her son JohnMiles Dyson, and the T-800[2] destroyingCyberdyne headquarters and all backups of the research in 1995, the date for Judgment day is moved back to here.[3] Skynet is destined to go online a few days earlier on April 192011 at 20:11

Extending a Magento Controller

We’re ajaxing part of the Magento shopping cart so we need to modify/extend some of the cart controller functionality.  Sometimes when modifying controller’s you have to worry about updating the routes. For this, we don’t need to, we still want all the urls to be used the same way.

app/code/local/Ai/Checkout/etc/config.xml:

<config>
    <modules>
        <Ai_Checkout>
             <version>0.0.1</version>
        </Ai_Checkout>
    </modules>
...
    <frontend>
        <routers>
            <checkout>
                <use>standard</use>
                <args>
                    <module>Ai_Checkout</module>
                    <frontName>checkout</frontName>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

app/code/local/Ai/Checkout/controllers/CartController.php:

require_once Mage::getModuleDir('controllers', 'Mage_Checkout') . DS . 'CartController.php';

class Ai_Checkout_CartController extends Mage_Checkout_CartController
{
   public function updatePostAction()
    {
        Mage::log("NEW CONTROLLER", null, 'tim.log');
        try {

Moving Gmail Gadgets to the Right Side

I started using Remember the Milk recently but didn’t want the gmail gadget to be so far down on the left hand side of my screen.  There is no built in way to move gadgets to the right hand side with the exception of chat (labels used to do this but was removed in favor of drag in drop back in late 2009).

 

If you don’t have anything in the right hand column, enable Right-Side Chat from Gmail Labs.  We are going to add in some custom css to gmail so install either Stylist for Chrome or Stylish for Firefox.

Add the following style:

div.TZ:nth-child(8) {
    position:absolute !important;
    right:0px;
    top:165px;
    width:164px;
}

In chrome you can also restrict the domain to mail.google.com. For me, the Remember the Milk gadget was the 8th child. Play with this until it looks right for you. You may also have to play with the “top” element depending on how much room your chat gadget takes up

Performance Optimization WordPress Plugins by W3 EDGE