Skip to content

Instantly share code, notes, and snippets.

@markdboyd
markdboyd / FieldCollectionItem.php
Created May 10, 2017 17:08
Migrate D7 Field Collections to D8 Paragraphs
<?php
namespace Drupal\saintlukes_migrate\Plugin\migrate\source\d7;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;
/**
* Drupal 7 field_collection_item source from database.
*
@markdboyd
markdboyd / endpoints.md
Last active February 28, 2022 22:18
endpoint-tests.md
  • collections: OK
  • providers
@markdboyd
markdboyd / migration.js
Last active December 29, 2021 14:12
Drop constraint from Sequelize model
// Remove constraint and index
queryInterface.sequelize.query(
'ALTER TABLE "project" DROP CONSTRAINT IF EXISTS project_name_key;'
).then(function() {
return queryInterface.removeIndex('project', 'project_name_key');
});
// Add unique constraint and index
queryInterface.addIndex('project', ['name'], {
indexName: 'project_name_key',
@markdboyd
markdboyd / diff-filter.sh
Created October 3, 2017 18:39
Filter diff of deleted files
git diff --name-status --diff-filter=D 5fc32f5 HEAD | grep '.*\.module'
// your code goes here ...
(function () {
// Get the elements we need to act on or attach listeners to.
var household_list = document.querySelector('.household');
var form = document.querySelector('form');
var buttons = form.querySelectorAll('button');
var add_button = buttons[0];
var submit_button = buttons[1];
// Add click handlers.
diff --git a/geolocation.libraries.yml b/geolocation.libraries.yml
index 71c2fcf..b5dfaaf 100644
--- a/geolocation.libraries.yml
+++ b/geolocation.libraries.yml
@@ -22,6 +22,12 @@ geolocation.views.filter.geocoder:
dependencies:
- geolocation/geolocation.geocoder
+# HTML5 Geolocation API.
+geolocation.html5:
diff --git a/geolocation.libraries.yml b/geolocation.libraries.yml
index 71c2fcf..b5dfaaf 100644
--- a/geolocation.libraries.yml
+++ b/geolocation.libraries.yml
@@ -22,6 +22,12 @@ geolocation.views.filter.geocoder:
dependencies:
- geolocation/geolocation.geocoder
+# HTML5 Geolocation API.
+geolocation.html5:
diff --git a/geolocation.libraries.yml b/geolocation.libraries.yml
index 71c2fcf..b5dfaaf 100644
--- a/geolocation.libraries.yml
+++ b/geolocation.libraries.yml
@@ -22,6 +22,12 @@ geolocation.views.filter.geocoder:
dependencies:
- geolocation/geolocation.geocoder
+# HTML5 Geolocation API.
+geolocation.html5:
diff --git a/geolocation.libraries.yml b/geolocation.libraries.yml
index 71c2fcf..b5dfaaf 100644
--- a/geolocation.libraries.yml
+++ b/geolocation.libraries.yml
@@ -22,6 +22,12 @@ geolocation.views.filter.geocoder:
dependencies:
- geolocation/geolocation.geocoder
+# HTML5 Geolocation API.
+geolocation.html5:
(function ($, Drupal, drupalSettings) {
'use strict';
/**
* @namespace
*/
drupalSettings.geolocation.html5 = drupalSettings.geolocation.html5 || {};
drupalSettings.geolocation.html5.proximity_view_ids = drupalSettings.geolocation.html5.proximity_view_ids || [];
Drupal.behaviors.geolocationProximityHTML5 = {