Skip to content

Instantly share code, notes, and snippets.

View alexey-kuznetsov's full-sized avatar

Aliaksei Kuzniatsou alexey-kuznetsov

  • Webxayc
  • Tbilisi
View GitHub Profile
{"StreetDirPrefix":null,"DistanceToStreetComments":null,"PublicSurveyRange":null,"LeaseAssignableYN":null,"GreenWaterConservation":null,"NumberOfUnitsMoMo":null,"LivingAreaUnits":null,"SeatingCapacity":null,"TaxLegalDescription":"DEL PRADO CONDOSOUTH BLDG - TOWER I UNIT 303 3RD FLOOR UNDIV .127% INT IN COMMON ELEM","BuyerAgentDesignation":null,"YearEstablished":null,"BuyerTeamKey":null,"ListPriceLow":null,"ContingentDate":null,"LaundryFeatures":"CommonArea","Flooring":"Other","PhotosCount":12,"FireplacesTotal":null,"DaysOnMarketReplicationDate":"2018-09-04","ListTeamKey":null,"AdditionalParcelsYN":null,"CoBuyerAgentDirectPhone":null,"WaterfrontFeatures":"Other","PastureArea":null,"SeniorCommunityYN":false,"ViewYN":true,"Cooling":"CentralAir","ExteriorFeatures":"Balcony,Barbecue,Deck","CountryRegion":null,"OtherParking":null,"IrrigationWaterRightsAcres":null,"SourceSystemID":"TRESTLE","StatusChangeTimestamp":"2018-09-04T11:24:10.270-00:00","SecurityFeatures":"SmokeDetectors","BuyerAgentFullName":"Howard Montes
@alexey-kuznetsov
alexey-kuznetsov / docker-compose.yml
Created March 15, 2021 09:46
docker-compose.yml for d4d
version: "3.7"
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
[
{
"provider_name": "23HQ",
"provider_url": "http:\/\/www.23hq.com",
"endpoints": [
{
"schemes": [
"http:\/\/www.23hq.com\/*\/photo\/*"
],
"url": "http:\/\/www.23hq.com\/23\/oembed"
// No constructor method
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->logger = $container->get('logger.factory')->get('my_logger');
$instance->currentUser = $container->get('current_user');
return $instance;
<?php
namespace Drupal\wx_stepped_add_form\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\FormBuilderInterface;
use Drupal\Core\Url;
use Drupal\wx_stepped_add_form\Form\SteppedAddForm;
@alexey-kuznetsov
alexey-kuznetsov / ajaxForm.php
Created November 3, 2017 12:03
Working ajax form with multiple commands in response
/**
* AJAX process step
*/
public function processStep(array &$form, FormStateInterface $form_state) {
$ajax_response = new AjaxResponse();
$ajax_response->addCommand(new ReplaceCommand(
'h1.page-title',
'<h1 class="page-title">' . $this->getTitle() . '</h1>'
));
**
* Implements hook_ENTITY_TYPE_create().
*/
function custom_node_create(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->bundle() == 'task') {
$lock = \Drupal::lock();
if (empty($entity->nid->getValue())) {
// Lock tables to avoid numbers duplicate
if (!$lock->acquire('insert_task')) {
$lock->wait('insert_task');
uuid: 66045bab-c3c8-4711-90bb-cdda6b9f3a2a
langcode: ru
status: true
dependencies:
module:
- rest
- serialization
- user
id: check_user
label: 'Check user'