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 / 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;
@dublado
dublado / taskkill
Created May 10, 2017 19:39 — forked from niisar/taskkill
taskkill
Taskkill /IM win_word.exe /F
@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 / fix-wordpress-permissions.sh
Created March 22, 2018 18:37 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@dublado
dublado / Remove Submodule
Created March 22, 2018 19:52 — forked from kyleturner/Remove Submodule
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
@dublado
dublado / ffmpeg-watermark.md
Created April 5, 2018 20:52 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@dublado
dublado / Magento sanitiser
Created April 6, 2018 20:46 — forked from jimains/Magento sanitiser
Generic sql clean up Magento
-- this script is to be used on a DB dump from production
-- then this db can be dumped again, and used to override
-- a sample magento DB to add pepejeans catalog data and
-- sample configuration for dev VM
-- truncated tables will be truncated in magento db
-- dropped tables in this script will leave default magentodb tables
-- this script clears indexes, so the final db should be taken after reindexing in magento
SET foreign_key_checks = 0;
@dublado
dublado / clean-magento_ce-db-extended.sql
Created April 6, 2018 20:47 — forked from frozenminds/clean-magento_ce-db-extended.sql
Clean Magento database of junk and unnecessary data
--
-- Magento CE database clean-up extended
--
-- This is an extended clean-up which will clean search, import/export, reports, etc.
--
-- @author Constantin Bejenaru <boby@frozenminds.com>
-- @copyright Copyright (c) Constantin Bejenaru (http://frozenminds.com/)
-- @license http://www.opensource.org/licenses/mit-license.html MIT License
--
@dublado
dublado / categories.sql
Created April 6, 2018 20:47 — forked from ajardin/categories.sql
How to clean up a Magento database
DELETE cce , cceda , ccede , ccei , ccet , ccev FROM catalog_category_entity cce
LEFT JOIN
catalog_category_entity_datetime AS cceda ON cce.entity_id = cceda.entity_id
LEFT JOIN
catalog_category_entity_decimal AS ccede ON cce.entity_id = ccede.entity_id
LEFT JOIN
catalog_category_entity_int AS ccei ON cce.entity_id = ccei.entity_id
LEFT JOIN
catalog_category_entity_text AS ccet ON cce.entity_id = ccet.entity_id
LEFT JOIN
@dublado
dublado / customers.sql
Last active April 26, 2018 14:16 — forked from leek/_Magento1_DeleteTestData.md
Magento - Delete All Test Data - clean
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;