Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tadeusz Stępnikowski versedi

🎯
Focusing
View GitHub Profile
@versedi
versedi / gist:c81c29ee96a8fa3dd39beeb17edaa737
Created August 19, 2021 20:53
Numpad autocast with autohotkey
View gist:c81c29ee96a8fa3dd39beeb17edaa737
;The key (or mouse button) you press to activate the script. For a list of supported "keys" and combinations, see https://autohotkey.com/docs/Hotkeys.htm
;XButton1 = "Back"-Button on my mouse. For a complete list of special keys, see https://autohotkey.com/docs/KeyList.htm
#IfWinActive Last Epoch
#SingleInstance force
#NoEnv
#Warn
#Persistent
#MaxThreadsPerHotkey 2
@versedi
versedi / webpack.config.js
Last active January 6, 2023 09:28
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
View webpack.config.js
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
@versedi
versedi / .bash_aliases
Created January 23, 2017 09:58
Disable xdebug when running composer
View .bash_aliases
alias composer='php -n -d memory_limit=-1 -d extension=json.so -d extension=phar.so -d extension=pdo.so -d extension=tokenizer.so -d extension=ctype.so -d extension=dom.so -d extension=mbstring.so -d extension=mcrypt.so -d extension=xmlreader.so -d extension=xmlrpc.so -d extension=xmlwriter.so -d extension=curl.so -d extension=xml.so ~/bin/composer'
@versedi
versedi / activate-coupon-rules.php
Created December 29, 2016 16:32
Activate coupons sale rules by specific expiration date.
View activate-coupon-rules.php
<?php
$collection = Mage::getModel('salesrule/coupon')->getCollection()->addFieldToFilter('expiration_date', array('eq' => '2016-12-30 00:00:00'));
foreach($collection as $coupon) {
$rule = Mage::getModel('salesrule/rule')->load($coupon->getRuleId());
$rule->setIsActive(true)->save();
}
@versedi
versedi / prices_per_store.sql
Created December 2, 2016 11:54
GetPricesPerStores-MagentoSQL
View prices_per_store.sql
SELECT
CPE.sku,
CPED.value,
CPED.attribute_id,
CPED.store_id,
EAV.attribute_code
FROM
catalog_product_entity AS CPE
INNER JOIN catalog_product_entity_decimal AS CPED ON CPED.entity_id = CPE.entity_id AND CPED.attribute_id IN (75,76) AND CPED.store_id IN (1,2,3,4,5,14,15,0)
INNER JOIN eav_attribute AS EAV ON CPED.attribute_id = EAV.attribute_id
@versedi
versedi / MagentoEvents.md
Last active January 23, 2017 19:03
magento events table
View MagentoEvents.md
File Line Event
cron.php 46 default
Mage/Adminhtml/Controller/Action.php 159 adminhtml_controller_action_predispatch_start
Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php 61 adminhtml_block_html_before
Mage/Adminhtml/Block/Report/Grid.php 186 adminhtml_widget_grid_filter_collection
Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php 76 adminhtml_cms_page_edit_tab_meta_prepare_form
Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php 125 adminhtml_cms_page_edit_tab_design_prepare_form
Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php 119 adminhtml_cms_page_edit_tab_main_prepare_form
Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php 98 adminhtml_cms_page_edit_tab_content_prepare_form
@versedi
versedi / MagentoScenarios.md
Last active January 26, 2017 10:29
MagentoScenarios
View MagentoScenarios.md

Issues with tax calculation in Magento 1.9

Product tax class

  1. Make sure that product tax class is set to Taxable Goods on product edit page, tab Prices.

Customer groups >< tax class assignment

  1. Make sure customer groups are saved with proper customer tax class assigned (Customer > Customer Groups)

=====================

@versedi
versedi / Subscriber.php
Last active October 7, 2016 06:26
FIX-Magento-Untranslated-NonStyled-Newsletter-Subscription-Unsubscription-Emails-InlineCss-Not-Rendered-From-Backend.php
View Subscriber.php
<?php
// app/code/core/Mage/Core/Model/Email/Template/Abtract.php
//example on sendUnsubscriptionEmail but has to be done everywhere.
/**
* Sends out unsubsciption email
*
* @return Mage_Newsletter_Model_Subscriber
@versedi
versedi / prototype-validation-classes.md
Last active August 2, 2016 07:21
prototype-validation-classes
View prototype-validation-classes.md
Css Class Use Case / Error Message
validate-no-html-tags HTML tags are not allowed
validate-select Please select an option.
required-entry This is a required field.
validate-number Please enter a valid number in this field.
validate-number-range The value is not within the specified range.
validate-digits Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.
validate-digits-range The value is not within the specified range.
validate-alpha Please use letters only (a-z or A-Z) in this field.
@versedi
versedi / newsite.sh
Last active June 1, 2016 12:09
Shell script to automatically create new dev sites in Apache2, Usage: ./newsite mysite.dev /home/mysites/optional-full-path-to-site
View newsite.sh
#!/bin/bash
CYAN='\033[1;36m'
RED='\033[0;31m'
NC='\033[0m' # No Color
if [ `id -u` != 0 ]; then
echo -e "${RED}-- ERROR --${NC}"
echo -e "-- This script should be run as root so that files"
echo -e "-- can be created freely."
exit