Skip to content

Instantly share code, notes, and snippets.

View dublado's full-sized avatar
📭
Send me a Telegram

Thiago Machado dublado

📭
Send me a Telegram
View GitHub Profile
@dublado
dublado / gist:428c2061ed44d878e1064615079dce9e
Created February 5, 2018 23:29 — forked from drorata/gist:146ce50807d16fd4a6aa
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@dublado
dublado / taskkill
Created May 10, 2017 19:39 — forked from niisar/taskkill
taskkill
Taskkill /IM win_word.exe /F
@dublado
dublado / TBT_Rewards_1_13_0_0_fix.patch
Created August 12, 2013 13:14 — forked from killpond/TBT_Rewards_1_13_0_0_fix.patch
When upgrading Magento to 1.13.0.0 the TBT_Rewards caused me some issues since I was upgrading from an older version of the module. Latest version of the module that this patch is valid against http://www.sweettoothrewards.com/downloads/magento/tbtrewards-latest.tar.gz In version 1.1.1 of the module a "rules_hash" column is added to the "catalog…
diff -rupN TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php
--- TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-04-16 19:20:50.000000000 +0100
+++ TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-06-03 13:30:13.783568896 +0100
@@ -97,11 +97,13 @@ class TBT_Rewards_Model_Observer_Catalog
$product = $event->getProduct();
}
- if ( $product ) {
+ if ( is_numeric($product) ) {
+ $target_product_id = $product;