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
(function($){ | |
Drupal.behaviors.viewsInfiniteScroll = { | |
attach: function (context, settings) { | |
$(function(){ | |
if (this.processed) return; | |
this.processed=true; | |
if ($('.search-results').length==0) return; | |
var $container = $('.search-results'); | |
$container.imagesLoaded( function(){ | |
$container.infinitescroll({ |
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 | |
/** | |
* @file | |
* Template file for the example display. | |
* | |
* Variables available: | |
* | |
* $plugin: The pager plugin object. This contains the view. | |
* | |
* $plugin->view |
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
/** | |
* Js file to add load more button on the search result page. | |
*/ | |
(function ($) { | |
Drupal.behaviors.loadMoreAjax = { | |
attach: function (context, settings) { | |
$('.load-more-ajax', context).click(function () { | |
var nextPage = $('.pager .pager__item--next a').attr('href'); | |
var lastPage = $('.pager .pager__item--last a').attr('href'); |
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 |
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
<?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
<?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
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
/** | |
* {@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
<?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']); |
OlderNewer