Skip to content

Instantly share code, notes, and snippets.

View MrAlejandro's full-sized avatar

Alexander Shcherbachenko MrAlejandro

View GitHub Profile
@MrAlejandro
MrAlejandro / HS week1 (SQL).md
Last active November 5, 2021 16:05
HS PorstresQL
#+TITLE: Structured Query Language - HW day 1
#+AUTHOR: M. Surmashev @muradbei
#+PROPERTY: header-args:sql :engine postgresql :dbport 5400 :dbhost localhost :dbuser postgres :dbpassword postgres :database postgres

* Find gaps

  Дана таблица с числовой последовательностью из которой были удалены некоторые последовательности значений

  Задача - найти все удаленные последовательности
@MrAlejandro
MrAlejandro / surcharge.diff
Last active April 3, 2019 06:35
Order editing -> payment surcharge
diff --git a/app/controllers/backend/order_management.php b/app/controllers/backend/order_management.php
index 1c188d215a..72a2b7e9ea 100644
--- a/app/controllers/backend/order_management.php
+++ b/app/controllers/backend/order_management.php
@@ -54,6 +54,14 @@
}
}
+if (isset($_REQUEST['stored_payment_surcharge'])) {
+ $cart['stored_payment_surcharge'] = $_REQUEST['stored_payment_surcharge'];
@MrAlejandro
MrAlejandro / discussions.diff
Last active February 11, 2019 08:49
discussions.diff
diff -uraN a/app/addons/discussion/controllers/backend/products.pre.php b/app/addons/discussion/controllers/backend/products.pre.php
--- a/app/addons/discussion/controllers/backend/products.pre.php 1970-01-01 04:00:00.000000000 +0400
+++ b/app/addons/discussion/controllers/backend/products.pre.php 2019-02-11 12:40:06.000000000 +0400
@@ -0,0 +1,36 @@
+<?php
+/***************************************************************************
+ * *
+ * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
+ * *
+ * This is commercial software, only users who have purchased a valid *
@MrAlejandro
MrAlejandro / patch.diff
Last active October 23, 2018 11:01
Comments and reviews
diff --git a/app/addons/discussion/addon.xml b/app/addons/discussion/addon.xml
index f32ee3f113..5167156bd6 100644
--- a/app/addons/discussion/addon.xml
+++ b/app/addons/discussion/addon.xml
@@ -21,6 +21,8 @@
<variants>
<item id="any">
</item>
+ <item id="anonymous">
+ </item>
@MrAlejandro
MrAlejandro / patch.diff
Created August 16, 2018 07:48
Discussion default value
diff --git a/app/addons/discussion/Tygh/Enum/Addons/Discussion/DiscussionTypes.php b/app/addons/discussion/Tygh/Enum/Addons/Discussion/DiscussionTypes.php
new file mode 100644
index 0000000000..4ccf92162a
--- /dev/null
+++ b/app/addons/discussion/Tygh/Enum/Addons/Discussion/DiscussionTypes.php
@@ -0,0 +1,38 @@
+<?php
+/***************************************************************************
+ * *
+ * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
@MrAlejandro
MrAlejandro / RenderManager.diff
Created August 3, 2018 13:54
Grids width recalculation fix
diff --git a/app/Tygh/BlockManager/RenderManager.php b/app/Tygh/BlockManager/RenderManager.php
index 29183d96ae..e03d655760 100644
--- a/app/Tygh/BlockManager/RenderManager.php
+++ b/app/Tygh/BlockManager/RenderManager.php
@@ -273,13 +273,16 @@ protected function recalculateGridsBoundingBox($grids, $grids_content)
'alpha' => 0,
);
- // Found empty first-in-row (alpha only) or in-the-middle (non-alpha and non-omega) grid.
- // Its width will be added to the next grid and its alpha status will be assigned to the next grid.
@MrAlejandro
MrAlejandro / patch.diff
Created July 31, 2018 05:30
GDPR 404 footer fix
diff --git a/app/addons/gdpr/controllers/frontend/init.pre.php b/app/addons/gdpr/controllers/frontend/init.pre.php
deleted file mode 100644
index 9d2f3f0fed..0000000000
--- a/app/addons/gdpr/controllers/frontend/init.pre.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/***************************************************************************
- * *
- * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
diff --git a/app/Tygh/Tools/Url.php b/app/Tygh/Tools/Url.php
index 181473f66d..6dca041b7f 100644
--- a/app/Tygh/Tools/Url.php
+++ b/app/Tygh/Tools/Url.php
@@ -171,16 +171,21 @@ public function getQueryParams()
* Sets query parameters
*
* @param array $params Query parameters and their values
+ *
+ * @return Url
@MrAlejandro
MrAlejandro / .dbdiff
Created July 24, 2018 05:29
DBDiff patch
server1:
user: root
password: root
port: 3306
host: localhost
server2:
user: root
password: root
port: 3306
host: localhost
@MrAlejandro
MrAlejandro / gdpr.diff
Created July 20, 2018 12:07
GDPR + edit-content on site fix
diff --git a/app/Tygh/Mailer/AMessageBuilder.php b/app/Tygh/Mailer/AMessageBuilder.php
index 25950f6844..ff630849b9 100644
--- a/app/Tygh/Mailer/AMessageBuilder.php
+++ b/app/Tygh/Mailer/AMessageBuilder.php
@@ -170,6 +170,8 @@ public function createMessage($params, $area, $lang_code)
}
}
+ // disable editor mode before fetching email body from template
+ fn_disable_live_editor_mode();