Magento2 database transactions: how to save multiple model instances

Sometimes in your logic you have to save different model instances at once. Magento1 already had the concept of transaction, using the classic singleton model: Mage::getModel(‘core/resource_transaction’) Magento2 has its concept of transaction, too, so let’s see with a simple example how to use this feature. Let’s say we have a DB table ‘table’ described as … Continue Reading

How to make Selenium2 work for Mac OS X with Firefox Nightly and Python

This is one of the shortest articles ever, almost nothing to explain here. First, install Selenium2 through easy_install sudo easy_install selenium Then, simply go to the /Applications directory and create a symbolic link, because selenium looks for the Firefox binary in a  specific path: $ cd /Applications $ sudo ln -s FirefoxNightly.app Firefox.app   Time … Continue Reading

how to format your Java code with eclipse, without opening eclise

Ok this is a very small post, but if you look for this information through Google, for example, it’s hard to find an easy and clear answer. And here it is. Assuming your eclipse path is /Applications/eclipse/eclipse, and the all the Java code (even in subdirectories) resides in /Users/lorenzo/sources/java_project/, the command is the following:   … Continue Reading