Skip to content

Instantly share code, notes, and snippets.

View Oleksii909's full-sized avatar
👍
Focusing on drupal

Oleksii Bondarenko Oleksii909

👍
Focusing on drupal
View GitHub Profile
package mac
import (
"context"
"fmt"
"log"
"network-chesswork/utilities"
"os"
"os/signal"
"sync"
🌞 Morning 74 commits ████████▏░░░░░░░░░░░░ 38.7%
🌆 Daytime 42 commits ████▌░░░░░░░░░░░░░░░░ 22.0%
🌃 Evening 11 commits █▏░░░░░░░░░░░░░░░░░░░ 5.8%
🌙 Night 64 commits ███████░░░░░░░░░░░░░░ 33.5%
@Oleksii909
Oleksii909 / LOG-file.txt
Created April 18, 2024 10:52
CDK deploy logs
❌ DrupalCoreStackdrupal-9-localgov failed: Error: The stack named DrupalCoreStackdrupal-9-localgov failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Cannot find version 8.0.mysql_aurora.3.02.2 for aurora-mysql (Service: Rds, Status Code: 400, Request ID: cfed87d9-244a-44ee-a7ef-1a1ee9d3c338)" (RequestToken: da3d5693-9a5b-6bbb-da26-82b1eae584b9, HandlerErrorCode: InvalidRequest), Cannot set status to FAILED from status SUCCESS
at FullCloudFormationDeployment.monitorDeployment (/Users/oleksiibondarenko/.npm/_npx/fa14b75510cd2922/node_modules/aws-cdk/lib/index.js:433:10615)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (/Users/oleksiibondarenko/.npm/_npx/fa14b75510cd2922/node_modules/aws-cdk/lib/index.js:436:200503)
at async /Users/oleksiibondarenko/.npm/_npx/fa14b75510cd2922/node_modules/aws-cdk/lib/index.js:436:181341
(Reading database ...
@Oleksii909
Oleksii909 / ContactBook.sol
Created September 13, 2023 17:17
Lecture 6 Blockchain Homework
// SPDX-License-Identifier: GPL-3.0
pragma solidity >0.8.2;
// unsigned integer
contract ContactBook {
// dynamic data types
string public myName;
string[] names;
<?php
// JSONPath converts JSON objects to PHP objects which cause Migrate to
// fail when using the SubProcess process plugin. This function
// recursively converts those objects to arrays to prevent this issue.
$toArray = function ($x) use (&$toArray) {
return (is_scalar($x) || is_null($x)) ? $x : array_map($toArray, (array) $x);
};
$field_data = $toArray($field_data);
$this->currentItem[$field_name] = $field_data;
@Oleksii909
Oleksii909 / Drupal8HorizontalTabs.php
Created May 19, 2023 07:35 — forked from normanlolx/Drupal8HorizontalTabs.php
How to create horizontal tabs programmatically in Drupal 8, requires Field Group module
<?php
// How to create horizontal tabs programmatically in Drupal 8, requires Field Group module
$form = array();
$form['my_field'] = array(
'#type' => 'horizontal_tabs',
'#tree' => TRUE,
'#prefix' => '<div id="unique-wrapper">',
'#suffix' => '</div>',
);
$items = array(
@Oleksii909
Oleksii909 / drop_tables.sql
Created May 8, 2023 14:51
Delete tables in database started with specific prefixes
-- Set up variable to delete ALL tables starting with 'allane_, default_, dp_, neuwagenabo_'
-- $(drush sql:connect) < drop-tables.sql
-- mysql -u drupal -pdrupal drupal < drop-tables.sql
SET GROUP_CONCAT_MAX_LEN=999999999;
SET @tbls = (SELECT GROUP_CONCAT(TABLE_NAME)
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'drupal'
AND (
TABLE_NAME LIKE 'allane_%'
@Oleksii909
Oleksii909 / SiteLogoBlock.php
Created July 29, 2021 08:40 — forked from normanlolx/SiteLogoBlock.php
Drupal 8 file upload block
<?php
namespace Drupal\mymodule\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\file\Entity\File;
use Drupal\file\FileUsage\FileUsageInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@Oleksii909
Oleksii909 / ImageRenderExampleBlockByURI.php
Created July 28, 2021 15:26 — forked from jerbob92/ImageRenderExampleBlockByURI.php
Render image into a block Drupal 8 Example by URI
<?php
/**
* @file
* Contains Drupal\mymodule\Plugin\Block\ImageRenderExampleBlockByURI.
*/
namespace Drupal\mymodule\Plugin\Block;
use Drupal\Core\Block\BlockBase;
@Oleksii909
Oleksii909 / Add in container for xdebug
Created July 17, 2021 01:47
xdebug in DBB container
Build process completed successfully
Installing '/usr/lib/php/20190902/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.9.2
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=/usr/lib/php/20190902/xdebug.so" to php.ini
find: '/usr/lib/php/20180731/': No such file or directory
Removing intermediate container efb6556b1815