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
| <?php | |
| function trans($key){ | |
| static $translates = [ | |
| 'months_1' => 'Styczeń', | |
| 'months_2' => 'Luty', | |
| 'months_3' => 'Marzec', | |
| 'months_4' => 'Kwiecień', | |
| 'months_5' => 'Maj', | |
| 'months_6' => 'Czerwiec', | |
| 'months_7' => 'Lipiec', |
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
| $('body').on('click', function (e) { | |
| var isPopoverClicked = ($(e.target).parents('.popover-x').length > 0); | |
| var isButtonPopoverClicked = $(e.target).is('.publicKeyPopoverButton'); | |
| if(isPopoverClicked || isButtonPopoverClicked){ | |
| return true; | |
| } | |
| $('.popover-x').popoverX('hide'); | |
| }); |
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
| function reInintPopovers(){ | |
| var $btns = $("[data-toggle='popover-x']"); | |
| if ($btns.length) { | |
| $btns.popoverButton(); | |
| } | |
| } | |
| $(document).on('pjax:end', function() { | |
| reInintPopovers(); | |
| }); |
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
| document._keyPushTimeoutId = 0; | |
| $(document).on('keyup', 'input.form-control', function(){ | |
| var element = $(this); | |
| window.clearTimeout(document._keyPushTimeoutId); | |
| document._keyPushTimeoutId = setTimeout(function(){ | |
| element.change(); | |
| }, 500); | |
| }); |
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
| body { | |
| color: #000; | |
| background: #525252 url("/assets/img/cloud-bar.png") repeat-x; | |
| } | |
| .docs_main p { | |
| color:#000; | |
| } | |
| aside div { | |
| background: #c5c5c5; | |
| } |
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
| USE test; | |
| -- we use recursive CTE to find a tree of managers and count their place in hierarchy tree from top to bottom | |
| -- remarks: | |
| -- 1) you must add recursive word when using recursion in MariaDB | |
| -- 2) you must SELECT from table, NOT FROM cte inside recursive part | |
| -- https://mariadb.com/kb/en/recursive-common-table-expressions-overview/ | |
| WITH RECURSIVE cte_employee AS | |
| ( | |
| -- anchor part where we look for CEO who is on top of hierarchy | |
| SELECT employee.*, 0 AS hierarchy_level FROM employee |
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
| DROP TABLE IF EXISTS `test`.`employee`; | |
| CREATE TABLE `test`.`employee` ( | |
| `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| `name` VARCHAR(45) NULL, | |
| `manager_id` INT UNSIGNED NOT NULL, | |
| PRIMARY KEY (`id`)); | |
| INSERT INTO `test`.`employee` (`name`, `manager_id`) VALUES ('Dev1', '10'); | |
| INSERT INTO `test`.`employee` (`name`, `manager_id`) VALUES ('Dev2', '10'); |
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
| USE test; | |
| DROP TABLE IF EXISTS `employee`; | |
| CREATE TABLE `employee` ( | |
| `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| `name` VARCHAR(45) NULL, | |
| `manager_id` INT UNSIGNED NOT NULL, | |
| PRIMARY KEY (`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
| name | color | price | |
|---|---|---|---|
| Laptop | black | 11000.00 | |
| Jeans | blue | NULL |
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 TABLE test ( | |
| id INT PRIMARY KEY AUTO_INCREMENT, | |
| year SMALLINT, | |
| month TINYINT, | |
| revenue INT | |
| ); | |
| INSERT INTO test (year, month, revenue) VALUES | |
| (2020, 01, 900), | |
| (2020, 02, 1500), |
OlderNewer