View updatenode.php
<?php | |
$entityTypeManager = \Drupal::entityTypeManager(); | |
$storage = $entityTypeManager->getStorage('node'); | |
// Replace <article> with your nodetype. | |
$query = $storage->getQuery() | |
->condition('type', 'article') | |
->execute(); | |
// Chunk in case you have thousands of nodes to update. | |
foreach (array_chunk($query, 200) as $chunk) { |
View inserter.cpp
#include <iostream> | |
#include <set> | |
#include <string> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
using std::set; | |
using std::string; | |
using std::cin; |
View all-or-nothing.js
import React from "react" | |
const fetch = require("isomorphic-fetch"); | |
const { compose, withProps, withHandlers, withStateHandlers } = require("recompose"); | |
const demoFancyMapStyles = require("./demoFancyMapStyles.json"); | |
const FaAnchor = require("react-icons/lib/fa/anchor"); | |
const { | |
withScriptjs, | |
withGoogleMap, | |
GoogleMap, | |
Marker, |
View propersubmit.php
<?php | |
namespace Drupal\general\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* List tests arranged in groups that can be selected and run. | |
*/ |
View submitidentifier.php
<?php | |
namespace Drupal\general\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* List tests arranged in groups that can be selected and run. | |
*/ |
View UserCleanup.php
<?php | |
$users = \Drupal::entityQuery('user') | |
->execute(); | |
$max = count($users); | |
$pointer = 0; | |
foreach (array_chunk($users, 100) as $chunk) { | |
foreach ($chunk as $user_id) { | |
$pointer++; |