$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
function run(input, parameters) { | |
const appNames = []; | |
const skipAppNames = []; | |
const verbose = true; | |
const scriptName = "close_notifications_applescript"; | |
const CLEAR_ALL_ACTION = "Clear All"; | |
const CLEAR_ALL_ACTION_TOP = "Clear"; |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
git log\ | |
| grep "Merge pull request.*{INSERT STORY ID HERE}" -B 5\ | |
| awk '{\ | |
if ($1=="commit") {\ | |
print system("git diff " $2 "^ " $2);\ | |
}\ | |
}' |
git log --shortstat --since="1 year ago" --until="now" \ | |
| grep "files changed\|Author\|Merge:" \ | |
| awk '{ \ | |
if ($1 == "Author:") {\ | |
currentUser = $2;\ | |
}\ | |
if ($2 == "files") {\ | |
files[currentUser]+=$1;\ | |
inserted[currentUser]+=$4;\ | |
deleted[currentUser]+=$6;\ |
The individual files in this gist each have a unique trick to offer. They may be moved to official documentation or individual gists at a future date. | |
This file is mostly added because gists insist on titling the page with the alphabetically first file name, instead of the gist title. |
<?php | |
namespace Drupal\my_module\Services; | |
use Drupal\Core\Config\ConfigFactory; | |
/** | |
* Class MyService. | |
* | |
* @package Drupal\my_module\Services |
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
SELECT | |
TABLE_SCHEMA, | |
TABLE_NAME, | |
DATA_LENGTH / POWER(1024,1) Data_KB, | |
DATA_LENGTH / POWER(1024,2) Data_MB, | |
DATA_LENGTH / POWER(1024,3) Data_GB | |
FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql') ORDER BY DATA_LENGTH; |