Skip to content

Instantly share code, notes, and snippets.

View mikeshiyan's full-sized avatar
🇺🇦
Defending peace

Mike Shiyan mikeshiyan

🇺🇦
Defending peace
View GitHub Profile
#!/usr/bin/node
/**
* @file
* NodeJS/Puppeteer скрипт для экспорта персональных списков с КиноПоиска в CSV.
*
* Команда:
* node kinopoisk-list-export.js url [путь-к-файлу.csv]
*
* Поддерживаемые списки и URL:
* - Оценки + просмотры пользователя. Пример URL для использования в командной
@mikeshiyan
mikeshiyan / .lando.yml
Last active December 19, 2023 13:33
Landofile for running PHPUnit and Nightwatch JS tests in a local Drupal repo (any branch).
name: drupal-test
recipe: drupal9
config:
webroot: .
php: 8.1
services:
appserver:
build_as_root:
# Install nodejs and yarn in the main container. They have to live here
# because PHP is required for the site installation and other ops in
@mikeshiyan
mikeshiyan / .gitignore
Last active August 10, 2022 07:57
Quick local drupal/recommended-project with lando
# Composer-generated directories.
/vendor/
/web/core/
/web/libraries/
/web/modules/contrib/
/web/profiles/contrib/
/web/themes/contrib/
/drush/Commands/contrib/
# Scaffold files.
@mikeshiyan
mikeshiyan / BatchBase.php
Last active November 21, 2018 15:10
Base class for batches for Drupal 7 (min PHP 7.1).
<?php
/**
* Provides a base class for all batches.
*/
abstract class BatchBase {
/**
* Batch machine name.
*
@mikeshiyan
mikeshiyan / RenewablePersistentDbLockBe.php
Last active November 21, 2018 15:12
Renewable persistent database lock backend class for Drupal 7 (min PHP 7.1). Perfect for locking batch process.
<?php
/**
* Defines the renewable persistent database lock backend.
*/
class RenewablePersistentDbLockBe {
/**
* Lock token identifier.
*
@mikeshiyan
mikeshiyan / error.backtrace
Last active October 30, 2018 09:36
Error: Call to a member function getFieldStorageDefinition() on array in Drupal\Core\Field\TypedData\FieldItemDataDefinition->getPropertyDefinitions() (line 66 of core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php) for https://www.drupal.org/project/drupal/issues/2750463
Drupal\Core\Field\TypedData\FieldItemDataDefinition->getPropertyDefinitions() (Line: 50)
Drupal\Core\Field\FieldItemBase->__construct(Object, 0, Object) (Line: 46)
Drupal\Core\TypedData\TypedData::createInstance(Object, 0, Object) (Line: 91)
Drupal\Core\TypedData\TypedDataManager->createInstance('field_item:entity_reference', Array) (Line: 103)
Drupal\Core\TypedData\TypedDataManager->create(Object, NULL, 0, Object) (Line: 187)
Drupal\Core\TypedData\TypedDataManager->getPropertyInstance(Object, 0, '1') (Line: 82)
Drupal\Core\Field\FieldTypePluginManager->createFieldItem(Object, 0, '1') (Line: 40)
Drupal\Core\Field\FieldItemList->createItem(0, '1') (Line: 66)
Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue(Array, ) (Line: 118)
Drupal\Core\Field\FieldItemList->setValue(Array, ) (Line: 195)
<?php
/**
* @file
* Analogue of JS Unsigned Right Shift Operator (>>>).
*/
/**
* Shifts $int in binary representation $steps (< 32) bits to the right,
* discarding bits shifted off, and shifting in zeros from the left.