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
/** | |
* You may use this function with both 2 or 3 interval colors for your gradient. | |
* For example, you want to have a gradient between Bootstrap's danger-warning-success colors. | |
*/ | |
function colorGradient(fadeFraction, rgbColor1, rgbColor2, rgbColor3) { | |
var color1 = rgbColor1; | |
var color2 = rgbColor2; | |
var fade = fadeFraction; | |
// Do we have 3 colors for the gradient? Need to adjust the params. |
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
var resizeBuffer = null; | |
var prevWidthName = getWindowWidthName(); | |
$(window).on('resize', function () { | |
clearTimeout(resizeBuffer); | |
resizeBuffer = setTimeout(function() { | |
var newWidthName = getWindowWidthName(); | |
if (newWidthName != prevWidthName) { | |
prevWidthName = newWidthName; | |
$(document).trigger(newWidthName); | |
} |
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 | |
/** | |
* Generates a pagination array | |
* | |
* @param int $total_items | |
* @param int $page_size | |
* @param int $current_page | |
* @return array $pagination | |
*/ |
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 | |
/** | |
* Converts an integer number to a word in Lithuanian language. | |
* | |
* @param int $number Integer number to be converted into words | |
* @param array|bool $units Units array like array(0 => šimtas, 1 => šimtai, 2 => šimtų); | |
* @param bool $one If false, word "vienas" is omitted | |
* @return string | |
*/ |
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
<style type="text/css"> | |
/* | |
* Allows to usage of <ul> as .row and <li> as .col-**-* | |
* Benefit of using <li> is that the column can be of varied height, | |
* unlike when using div.row - columns collapse when heights are different. | |
* The tricky part is to eliminate whitespaces between <li></li> tags. | |
* | |
* Usage: <ul class="list-grid row"> | |
* <li class="col-md-3">...</li> | |
* |
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
<div class="spinbox" data-min="1" data-max="10" data-step="2"> | |
<input class="form-control spinbox-input" type="text" value="1"> | |
<div class="spinbox-buttons"> | |
<button class="spinbox-up btn btn-default btn-xs" type="button">+</button> | |
<button class="spinbox-down btn btn-default btn-xs" type="button">-</button> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
// jQuery must be available before binding events |
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 | |
class Db | |
{ | |
public function batchInsert($table, array $rows, array $columns = array()) | |
{ | |
// Is array empty? Nothing to insert! | |
if (empty($rows)) { | |
return true; | |
} |
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 | |
if (!defined('_PS_VERSION_')) | |
exit; | |
class BlockUserInfoOverride extends BlockUserInfo | |
{ | |
public function hookDisplayTop($params) | |
{ | |
$this->smarty->assign(array( |
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 | |
if (!defined('_PS_VERSION_')) | |
exit; | |
class BlockUserInfoOverride extends BlockUserInfo | |
{ | |
public function hookDisplayTop($params) | |
{ | |
if (!$this->active) |