$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');
pipeline = ffmpeg.Pipeline() | |
silence, = pipeline.input(Filter("aevalsrc", 0, 1, filter_options=[ # using anullsrc corrupts the audio | |
"0", "channel_layout=stereo", "sample_rate=44100" | |
])) | |
color, = pipeline.input(Filter("color", 0, 1, filter_options=[ | |
"color=0x009999", | |
"duration=" + str(duration), | |
"rate=" + str(config.framerate), | |
"size=1920x1080", | |
])) |
<?php | |
/** | |
* @file | |
* Convert a YAML file to PHP code to write its values to the database. | |
*/ | |
use Drupal\Component\Serialization\Yaml; | |
// Replace 'filter.format.full_html' with any other existing configuration |
/** | |
* Some simple modifications that can help when dealing with an admin/interface language | |
* and a content language that have different directions (dir: ltr or rtl) | |
* | |
* Snippet to get current language of content. | |
* \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT) | |
* | |
* Snippet to get current language of interface. This should be set to the users admin preference. | |
* \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_INTERFACE) | |
* |
/* global chrome, MediaRecorder, FileReader */ | |
chrome.runtime.onConnect.addListener(port => { | |
let recorder = null | |
port.onMessage.addListener(msg => { | |
console.log(msg); | |
switch (msg.type) { | |
case 'REC_STOP': | |
console.log('Stopping recording') | |
if (!port.recorderPlaying || !recorder) { |
[Update 2024] - Take a look at Drupal at your fingertips. Lot's of great stuff there.
// Load file object
$file = File::load($fid);
<?php | |
/** | |
* @file | |
* Contains \Drupal\example_module\Controller\ExampleModuleController. | |
*/ | |
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php | |
namespace Drupal\example_module\Controller; |
The official AWS command line tools, have support for configuration profiles. See Configuring the AWS Command Line Interface - Named Profiles.
Managing multiple profiles with the AWS CLI itself is relatively straight forward, switching between them with --profile
flag on the command line or the AWS_PROFILE
environment variable.
These helpers extend that functionality for convenience with other tools in the ecosystem.