Skip to content

Instantly share code, notes, and snippets.

View tanmayk's full-sized avatar

Tanmay Khedekar tanmayk

  • Opensource Seed
  • India
View GitHub Profile
#!/bin/bash
cd /PATH/TO/SITE
echo "Pulling latest copy of master branch..."
git pull origin master
echo "Installing dependencies"
composer install
echo "Synchronizing configurations"
drush cim -y --verbose
echo "Rebuilding cache"
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
<?php
/**
* @codingStandardsIgnoreFile
*/
/**
* Database configurations.
*/
$databases['default']['default'] = array (
version: 2
jobs:
build:
docker:
- image: osseed/drupal8:7.2
- image: circleci/mysql:5.7
environment:
MYSQL_DATABASE: drupal
MYSQL_ROOT_USERNAME: root
MYSQL_ROOT_PASSWORD: root
@tanmayk
tanmayk / features-revert-d8.php
Created January 29, 2019 09:19
D8 equivalent of features_revert.
<?php
$manager = \Drupal::service('features.manager');
$module = 'MODULE_MACHINE_NAME';
$feature = $manager->loadPackage($module, TRUE);
$config_to_create = [
'CONFIG_NAME_1' => '',
'CONFIG_NAME_2' => '',
];
// Import the configurations.
YAML
-
name: 'Parent 1'
children:
-
name: 'Child 1'
children:
-
name: 'Child 11'
* theme = "views_view_scroller",
<?php
/**
* @file
* Theme for My Scroller views.
*/
/**
* Prepares variables for views scroller templates.
*
<?php
/**
* @file
* My Scroller Views module help and theme functions.
*/
// Store Scroller preprocess theme functions in a separate .inc file.
\Drupal::moduleHandler()->loadInclude('my_scroller', 'inc', 'my_scroller.theme');
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['height'] = array(
'#type' => 'textfield',
'#title' => $this->t('Height'),
'#description' => $this->t('Default height of header.'),
'#size' => '6',
'#default_value' => $this->options['height'],
'#required' => TRUE,