Skip to content

Instantly share code, notes, and snippets.

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under bridge100 > inet. It is typically 10.211.55.2.

@timodwhit
timodwhit / MODULE_NAME.module.php
Last active April 26, 2016 15:12
Generate and Enable Feature
<?php
/**
* Implements hook_form_alter().
*/
function MODULE_NAME_form_features_export_form_alter(&$form, &$form_state, $form_id) {
$rebuild = array_search('features_form_rebuild', $form['advanced']['generate']['#submit']);
unset($form['advanced']['generate']['#submit'][$rebuild]);
$form['advanced']['generate']['#submit'][] = 'ccp_install_features_export_enable_module';
$form['advanced']['generate']['#submit'][] = 'features_form_rebuild';
}
@timodwhit
timodwhit / gist:4cedf84f8c436572c276
Created October 1, 2015 14:40
Drush command for vampd database backup
<?php
$options['shell-aliases']['vdb'] = 'sql-dump --gzip --result-file --skip-tables-key=common';
$options['structure-tables'] = array(
'common' => array(
'advagg_aggregates',
'advagg_aggregates_hashes',
'advagg_aggregates_versions',
'advagg_files',
'cache',
@timodwhit
timodwhit / drushrc.php
Created October 1, 2015 14:37
Revert Drupal Environment in drushrc.php
<?php
$options['shell-aliases']['env-revert'] = '!drush env-switch production --force && drush cc all';
@timodwhit
timodwhit / menu_links.inc
Last active August 29, 2015 14:27
Menu Links Migrations
@timodwhit
timodwhit / view_list.php
Last active August 29, 2015 14:20
Get a list of views of a certain type
// Return an array of Data Export Views for a select list.
$vde_views = array();
// It is true, there is no better way to parse the views.
$views = views_get_enabled_views();
// Loop through each enabled views.
foreach ($views as $view) {
$id = $view->name;
$human_name = $view->human_name;
// Now loop through each display of each view.
foreach ($view->display as $display) {
"multisite" : "/assets/distro/current/htdocs/sites/"
unless site[:drupal][:multisite].nil?
link release_path do
to "#{site[:drupal][:multisite]}/#{site_name}"
end
release_path = "#{site[:drupal][:multisite]}/#{site_name}"
end
@timodwhit
timodwhit / gist:eda8daac91cc01e6805e
Last active August 29, 2015 14:13
Backdrop JSON
{
"name": "backdrop",
"description": "The base role that gets added to every machine.",
"chef_type": "role",
"json_class": "Chef::Role",
"default_attributes": {},
"override_attributes": {
"drupal": {
"sites": {
"backdrop": {
@timodwhit
timodwhit / drupal_block.sublime-snippet
Last active August 29, 2015 14:13
Sublime Snippet for Custom Block in Drupal 7
<snippet>
<content><![CDATA[
/**
* Implements hook_block_info().
*/
function ${1:YOUR_MODULE}_block_info() {
\$blocks = array();
\$blocks['${2:YOUR_BLOCK_ABC}'] = array(
'info' => t('${3:YOUR BLOCK NAME}'),
);
"scripts":{
"post_deploy":[],
"post_install":[],
"post_import":[],
"post_update"[]
}