Skip to content

Instantly share code, notes, and snippets.

View rodde177's full-sized avatar

rodde177

  • sthlm
View GitHub Profile
@rodde177
rodde177 / gist:d02e5bb6ae6a1e155c28
Last active August 29, 2015 14:18
Insert deleted review
INSERT INTO review VALUES(640,'2015-03-24 19:52:37',1,125,1);
SELECT * FROM reviews;
SELECT * FROM review_detail WHERE review_id = 640;
git reset --hard 387a190
git push origin master -f
(-f = forced)
<reference name="head">
<block type="core/text" name="google.font.muli">
<action method="setText">
<text>
<![CDATA[<link href='//fonts.googleapis.com/css?family=Muli' rel='stylesheet' type='text/css'>]]>
</text>
</action>
</block>
</reference>
@rodde177
rodde177 / gist:f524cc46b3c485cbb8e9
Created April 30, 2015 07:54
Change base url command line
use my_database;
select * from core_config_data where path like '%base%url%';
update core_config_data set value = 'http://domainname/' where path = 'web/unsecure/base_url';
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url';
<reference name="footer">
<block type="core/text" name="facebook.widget">
<action method="setText">
<text>
<![CDATA[<div class='fb-page' data-href='https://www.facebook.com/lovelly.se' data-width='280' data-height='240' data-hide-cover='false' data-show-facepile='true' data-show-posts='false'><div class='fb-xfbml-parse-ignore'><blockquote cite='https://www.facebook.com/lovelly.se'><a href='https://www.facebook.com/lovelly.se'>LOVeLLY</a></blockquote></div></div>]]>
</text>
</action>
</block>
</reference>
@rodde177
rodde177 / git_revert
Created May 26, 2015 13:27
git revert
#goes back to old commit and remove files from new commit
git reset --hard hte_hash
git push origin master --force
@rodde177
rodde177 / git-rm
Created June 1, 2015 13:51
Remove files from git
git status | grep deleted | awk '{print $3}'
Now that we have our complete list of deleted files, we can 'git rm' them:
git rm `git status | grep deleted | awk '{print $3}'`
@rodde177
rodde177 / convert_currency.php
Created June 5, 2015 11:12
Convert Currency Magento
<?php
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
$currencySpecificAmount = Mage::helper('directory')->currencyConvert($baseAmount, $currentCurrencyCode, $baseCurrencyCode);
@rodde177
rodde177 / gist:b3b41faa0ac5bf21e065
Last active August 29, 2015 14:24
get configurable products attribute id
$theId = Mage::getModel('catalog/product_type_configurable')->getConfigurableAttributeCollection($product)->getColumnValues('attribute_id');
//$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product); //$attributeIds instead of null
//$childProducts = $product->getTypeInstance()->getUsedProducts();
@rodde177
rodde177 / productfeed
Created July 13, 2015 13:30
productfeed table
<?php
$installer = $this;
$installer->startSetup();
$cdonFeedTable = $installer->getTable('nwtcdon/feed');
// Table 'nwtcdon/feed'
if (!$installer->getConnection()->isTableExists($cdonFeedTable)) {