Skip to content

Instantly share code, notes, and snippets.

View alexlcdee's full-sized avatar

Alexander Larkin alexlcdee

View GitHub Profile
<?php
namespace App\Model\Task;
class Task
{
/**
* @var Uuid
*/
export function(parentSelector, selector, prevArrowImg, nextArrowImg) {
$(parentSelector).on('click', selector, function(e){
e.preventDefault();
let link = $(this);
let prev = $(this).parent().prev().find('a');
let next = $(this).parent().next().find('a');
let content = $('<div class="clearfix"></div>').css({
'width': '900px',
'max-width':'calc(100vw - 100px)',
'position': 'relative'
<?php
class PhpAuthManager extends CPhpAuthManager
{
// your code
public function executeBizRule($bizRule, $params, $data)
{
$bizRule = $bizRule ? @unserialize($bizRule) : null;
if (is_callable($bizRule)) {
return call_user_func_array($bizRule, [$params, $data]);
@alexlcdee
alexlcdee / batch-query.php
Last active February 11, 2021 08:50
batch query
<?php
$itemsPerRequest = 50;
$itemsCriteria = array(
'condition' => 't.type = 2 AND t.isDeleted != 1 AND t.isActive = 1 AND t.itemType = 1000',
'order' => 'id ASC',
'limit' => $itemsPerRequest,
'offset' => 0,
);
$i = 0;
@alexlcdee
alexlcdee / alphabet.php
Created October 6, 2017 10:41
Алфавит
$abc = array();
foreach (range(chr(0xC0), chr(0xDF)) as $b) {
$abc[] = iconv('CP1251', 'UTF-8', $b);
}
@alexlcdee
alexlcdee / using-batch-query-class.php
Created October 6, 2017 10:41
using-batch-query-class
/**
* Starts a batch query.
*
* A batch query supports fetching data in batches, which can keep the memory usage under a limit.
* This method will return a [[BatchQueryResult]] object which implements the [[\Iterator]] interface
* and can be traversed to retrieve the data in batches.
*
* For example,
*
* ```php
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({__proto__: []} instanceof Array && function (d, b) {
d.__proto__ = b;
}) ||
function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
};
return function (d, b) {
extendStatics(d, b);
var GalaMessaging;
(function (GalaMessaging) {
var messagingPrivate = {
userId: 0,
apiHost: '',
userRole: ''
};
var Messaging = (function () {
function Messaging(config) {
var _this = this;
@alexlcdee
alexlcdee / Calculation.php
Last active August 15, 2017 21:33
test for delivery date
<?php
namespace App\Components\DeliveryCalculation;
use App\Components\Interfaces\DeliveryMethod\DeliveryMethodInterface;
class Calculation implements CalculationInterface, \JsonSerializable
{
/**