Skip to content

Instantly share code, notes, and snippets.

@btmash
btmash / SocialFeedCommands.php
Last active March 18, 2019 20:24
SocialFeedCommands.php ported
<?php
namespace Drupal\social_feed\Commands;
use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
use Drush\Commands\DrushCommands;
use Drupal\Core\Queue\QueueInterface;
use Drupal\Core\Queue\QueueWorkerInterface;
use Drupal\Core\Queue\SuspendQueueException;
@btmash
btmash / composer.json
Created March 18, 2019 18:46
Composer.json file (/social_feed/) before running generate
{
"name": "drupal/social_feed",
"type": "drupal-module",
"description": "Provides user an option to easily fetch feeds from Facebook, Twitter or Instagram and then display them accordingly using block",
"keywords": ["Drupal"],
"license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/social_feed",
"minimum-stability": "dev",
"support": {
"issues": "https://www.drupal.org/project/issues/social_feed",
@btmash
btmash / gist:95265a63e510374b0562a140395c78cf
Last active June 22, 2018 19:42
Delete Research nodes revisions
<?php
// Query all of the nids of the research content type.
$nids = db_select('node', 'n')
->fields('n', array('nid'))
->condition('type', 'research', '=')
->execute()
->fetchCol();
foreach ($nids as $nid) {