Skip to content

Instantly share code, notes, and snippets.

@mohit-rocks
mohit-rocks / import.php
Created December 4, 2018 11:56 — forked from crittermike/import.php
Importing Drupal 8 config programmatically
<?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.
@mohit-rocks
mohit-rocks / gist:bed1fc9f2d2c6213cebd7c9a0b18ef9c
Created August 3, 2016 10:06 — forked from mitchellh/gist:1277049
Configure Vagrant VM to use Host DNS for VPN
Vagrant::Config.run do |config|
# ...
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@mohit-rocks
mohit-rocks / gist:7d43ec7585b89a00bf4c
Created November 9, 2015 12:58 — forked from robertmarsal/gist:9feaa9150926efa4175a
Install f.lux on Ubuntu 14.10
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