For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CSRF and expired login forms | |
| How to handle a page with a login form that will expire | |
| If your homepage contains a login form, or a modal with login, then when the session ends (by default, after 2 hours) then the csrf token is no longer valid and the user sees a page expired warning after they have filled out their login details. | |
| We can work around this with a simple addition to the <head> of the main layout template. | |
| ``` | |
| <meta http-equiv="refresh" content="{{ config('session.lifetime') * 60 }}"> | |
| ``` | |
| This simple line will the page when it gets to the end of the session. The refreshed page will have a new session and a new csrf token. This way, your login form is always valid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Restoring product name from backup table | |
| -- where new name != backup name AND backup table name is `oc_product_description_n` | |
| -- Starting for each language ID - 1,3 | |
| DROP PROCEDURE IF EXISTS restore_product_name; | |
| DELIMITER $$ | |
| CREATE PROCEDURE restore_product_name() | |
| BEGIN | |
| DECLARE cursor_List_isdone BOOLEAN DEFAULT FALSE; | |
| DECLARE cur_product_id INT; | |
| DECLARE cur_name TEXT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Replace cyrillic 'x' by lat 'x' when 'x' between numbers | |
| DROP PROCEDURE IF EXISTS replace_char_product_name; | |
| DELIMITER $$ | |
| CREATE PROCEDURE replace_char_product_name() | |
| BEGIN | |
| DECLARE cursor_List_isdone BOOLEAN DEFAULT FALSE; | |
| DECLARE cur_product_id INT; | |
| DECLARE cur_name TEXT; | |
| DECLARE cur_finded TEXT; | |
| DECLARE cur_replaced TEXT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- searching doubles by id | |
| -- represent in the result all duplicated rows | |
| SELECT ptc.product_id, 1c_id, p.status, p.date_added, p.date_modified | |
| FROM oc_product_to_1c ptc | |
| LEFT JOIN oc_product p ON ptc.product_id=p.product_id | |
| WHERE EXISTS | |
| ( | |
| SELECT 1 | |
| FROM oc_product_to_1c ptcii | |
| WHERE ptcii.product_id = ptc.product_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Trigger for `oc_product_to_category` | |
| -- 1) IF INSERTED a new row with main_category = 1 | |
| -- 2) IF UPDATED with: new.main_category = 1 | |
| DELIMITER $$ | |
| DROP TRIGGER IF EXISTS update_product_trigger $$ | |
| CREATE TRIGGER update_product_trigger AFTER UPDATE ON oc_product_to_category FOR EACH ROW BEGIN | |
| IF NOT EXISTS(SELECT * FROM oc_version_changes WHERE entity_id=new.product_id AND entity_type='product') AND new.main_category = 1 THEN | |
| INSERT INTO oc_version_changes (entity_id,entity_type) VALUES (new.product_id, 'product'); END IF; END$$ | |
| DELIMITER ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Wordpress config | |
| [https://www.youtube.com/watch?v=c6PWC9m6Ai8] | |
| _wp-config.php_ | |
| ```php | |
| define( 'WP_DEBUG', true ); | |
| //Enable Debug logging to the /wp-content/debug.log file | |
| define( 'WP_DEBUG_LOG', true ); | |
| //End disable display debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Create mysql database and user, basic tips: | |
| -- sudo mysql -u root -p | |
| -- Show MySQL Users | |
| SELECT user FROM mysql.user; | |
| CREATE DATABASE [IF NOT EXISTS] database_name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gulp.task('sass', function(){ | |
| return gulp.src('catalog/view/theme/apple/stylesheet/stylesheet.sass') | |
| .pipe(sass({ | |
| includePaths: bourbon.includePaths | |
| })) | |
| .pipe(autoprefixer(['last 15 versions'], { cascade: true })) | |
| .pipe(gulp.dest('catalog/view/theme/apple/stylesheet/')) | |
| .pipe(browserSync.reload({stream: true})) | |
| }); |