Skip to content

Instantly share code, notes, and snippets.

View t10u's full-sized avatar

Toni Grigoriu t10u

View GitHub Profile
@t10u
t10u / keybase.md
Last active November 2, 2018 07:49

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@t10u
t10u / vagrant.pac
Created March 27, 2012 12:20
Proxy auto config file for vagrant boxes
function FindProxyForURL(url, host)
{
if (dnsDomainIs(host, ".local")) {
return "PROXY 33.33.33.66";
}
return "DIRECT";
}
@t10u
t10u / gist:2000875
Created March 8, 2012 12:55
Traits - decorator pattern
<?php
interface IDecoratedText
{
public function __toString();
}
trait TextDecorator
{
protected $text = null;
<?php
trait MySingleton
{
private $_foo = null;
private static $_instance = null;
private function __construct()
{
Vagrant::Config.run do |config|
config.vm.box = "ubuntu-oneiric-lamp"
config.vm.host_name = "ls"
#config.vm.boot_mode = :gui
config.vm.network :hostonly, "33.33.33.21"
config.vm.customize ["modifyvm", :id, "--memory", "1024"]
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
index c3303e0..1fce578 100755
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
@@ -453,23 +453,28 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model
*/
protected function _copyRelationIndexData($parentIds, $excludeIds = null)
{
- $write = $this->_getWriteAdapter();
- $select = $write->select()
INSERT INTO `catalog_product_index_price_final_tmp` SELECT `e`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, IF(IFNULL(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value) AS `tax_class_id`, ta_price.value AS `orig_price`, IF(IF(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value)) <= DATE(cwd.website_date), 1, 0)) > 0 AND IF(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NULL, 1, IF(DATE(IF(IFNULL(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value)) >= DATE(cwd.website_date), 1, 0)) > 0 AND ta_special_price.value < ta_price.value, ta_special_price.value, ta_price.value) AS `price`, IF(IF(IF(IFNULL(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_dat
@t10u
t10u / gist:1663087
Created January 23, 2012 13:20
Download Magento CE module
#!/usr/bin/env php
<?php
if (!isset($argv[1])) {
echo 'Magento extension key is required. Example usage: php '. $argv[0]. ' <Magento Connect 2.0 extension key>'. PHP_EOL;
exit(-1);
}
$mage_module_key = $argv[1];
$mage_module_name = basename($mage_module_key);
@t10u
t10u / 27004
Created January 12, 2012 13:55
Issue #27004
diff --git a/app/code/core/Mage/SalesRule/etc/adminhtml.xml b/app/code/core/Mage/SalesRule/etc/adminhtml.xml
index 3e4a7fa..c93b169 100644
--- a/app/code/core/Mage/SalesRule/etc/adminhtml.xml
+++ b/app/code/core/Mage/SalesRule/etc/adminhtml.xml
@@ -48,6 +48,17 @@
</quote>
</children>
</promo>
+ <system>
+ <children>
$ grep -r -i fuck magento2/
magento2/lib/PEAR/HTTP/Request.php: // magic quotes may fuck up file uploads and chunked response processing
magento2/pub/js/calendar/calendar.js: Calendar.continuation_for_the_fucking_khtml_browser = function() {
magento2/pub/js/calendar/calendar.js: setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
magento2/pub/js/calendar/calendar.js: Calendar.continuation_for_the_fucking_khtml_browser();
magento2/pub/js/prototype/window.js: // Fucking IE select issue