This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApiConsumer | |
{ | |
// Other variables, methods declaration. | |
// Full code: https://github.com/mohit-rocks/HelloWorldBundle/blob/master/Connection/ApiConsumer.php | |
/** | |
* Fetch the data from API endpoint. | |
*/ | |
public function getSubscribers() | |
{ | |
$users = $this->client->get('v2/api/fetch-dummy-users'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mautic | |
recipe: lamp | |
config: | |
webroot: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Import arbitrary config from a variable. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); | |
// Or, import YAML config an arbitrary directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_ENTITY_TYPE_presave(). | |
*/ | |
function unoconv_example_media_presave(EntityInterface $entity) { | |
$original_file_id = $entity->get('field_document_file')->getValue(); | |
/** @var \Drupal\file\Entity\File $file */ | |
$file = File::load($original_file_id[0]['target_id']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritdoc} | |
*/ | |
public function transcode($source_path, $destination_path, $destination_uri) { | |
$unoconv_config = $this->configFactory->get('unoconv_service.unoconvconfig'); | |
try { | |
$unoconv = Unoconv::create(array( | |
'timeout' => $unoconv_config->get('timeout'), | |
'unoconv.binaries' => $unoconv_config->get('binaries_path'), | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id: node_page | |
label: "Page Content" | |
migration_tags: | |
- content_import | |
# Notice ID Map plugin here. | |
idMap: | |
plugin: content_update | |
# ID Map plguin declaration ends. | |
source: | |
plugin: csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module\Plugin\migrate\id_map; | |
use Drupal\migrate\MigrateException; | |
use Drupal\migrate\Plugin\migrate\id_map\Sql; | |
/** | |
* Defines the sql based ID map implementation. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module; | |
use Drupal\Core\Language\LanguageInterface; | |
use Drupal\Core\Language\LanguageManagerInterface; | |
use Drupal\Core\Path\AliasStorageInterface; | |
class FallbackAliasStorage implements AliasStorageInterface { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |config| | |
# ... | |
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-glade2 python-appindicator | |
git clone https://github.com/Kilian/f.lux-indicator-applet.git | |
cd f.lux-indicator-applet | |
chmod +x setup.py | |
sudo ./setup.py install | |
fluxgui |
NewerOlder