Ctrl+Alt+Life: Hacking life, tech, and beyond.

  • Make jQuery colorbox plugin responsive

    Use jQuery colorbox lightbox plugin in responsive design with some native colorbox options jQuery(document).ready(function(){ jQuery(“.inline-sales”).colorbox({ inline:true, maxWidth: “90%”, onComplete : function() { jQuery(this).colorbox.resize(); } }); // resize colorbox on screen rotate in mobile devices and set to cover 90% of screen jQuery(window).resize(function() { jQuery.colorbox.resize({width:”90%”}); }); });

  • Magento re-install module’s install script

    Go to database find table ‘core_resources’ Search for your module and change back your installer version Then reloading any magento page will run installer again

  • Set a value as selected in select dropdown custom admin form in Magento

    I found this in Varien_Data_Form_Element_Select which generates the select option html $fieldset->addField( ‘sample’, ‘select’, array( ‘label’ => ‘Sample Dropdown’, ‘name’ => ‘sample’, ‘class’ => ”, ‘note’ => ”, ‘style’ => ”, ‘values’=> array(1=>’Yes’, 2=>’No’) ) ); Find: with in same form file $form->setValues($values); Add line before: // add this line just before setValues() $values[‘sample’] =…

  • Deploy Django in Heroku

    Deploy Python Django app in heroku cloud PostgreSQL needed since heroku don’t support sqlite3 install pgsql supports(not really required to install in your local but add in requirement.txt) pip install dj-database-url gunicorn whitenoise psycopg2 pip freeze > requirements.txt Somehow psycopg2 not installing in my local but I added psycopg2 in requirements.txt

  • Git Commands for beginners

    Remove a commit: Open terminal and go to your project directory then run command git reset –soft HEAD^

  • Make Battery from Lemon

    I really enjoyed making thus little weekend projects with Ananno

  • Magento Switch Store by Customer Group

    It’s really nice when you have many customer group and want to show different products to each customer group. This can be done by creating stores in Magento to view different products in each store and dedicate a store for a customer group. On a Multi Store Magento site where you have many customer group…

  • Magento Switch Store by Customer Group

    It’s really nice when you have many customer group and want to show different products to each customer group. This can be done by creating stores in Magento to view different products in each store and dedicate a store for a customer group. On a Multi Store Magento site where you have many customer group…

  • Magento Redirect Category link to CMS page, CMS page in Top menu by URL rewrite management

    Magento Redirect Category link to CMS page, CMS page in Top menu by URL rewrite management

    Sometime I have to add article content page and external url in Magento’s top navigation menu. This can be done without using any third-party extension. I have my own menu extension ready for any projects but when menu is not complex and all themes styling are ready for default navigation I use default Navigation. Magneto…

  • Magento Sort Products by Attribute Set

    To Sort Products by Attribute Set, Update the default toolbar files Mage/Catalog/block/Product/List/Toolbar.php

Need tech consultancy?