Skip to content

Instantly share code, notes, and snippets.

View eojthebrave's full-sized avatar

Joe Shindelar eojthebrave

View GitHub Profile
@eojthebrave
eojthebrave / dme_d7_taxonomy_term_tags.yml
Created July 14, 2021 16:42
Merge two diffferent Drupal 7 vocabularies into a single Drupal 8/9 vocabulary and dedupe terms
id: dme_d7_taxonomy_term_tags
migration_group: dmemigration
label: 'Taxonomy terms (Tags & Blog tags)'
source:
plugin: d7_taxonomy_term
# We're merging the D7 blog_tags, and tags taxonomies into one.
bundle:
- tags
- blog_tags
@eojthebrave
eojthebrave / entity_fields.php
Created July 1, 2021 14:54
Output a CSV file listing all fields and properties for Drupal 7 entity types to help prepare for a migration.
<?php
/**
* @file
* Create a CSV file with fields for every Drupal 7 entity type / bundle.
*
* When preparing for a Drupal 7 to Drupal 8/9 migration it can be helpful to
* perform some initial content analysis. This script creates CSV files that
* can be imported into Google Sheets etc. to help with this analysis.
*
// customer.json
{
"name": "Mega Corp.",
"order_count": 83,
"address": "Infinity Loop Drive",
}
#!/usr/bin/env node
console.log("OMG Yay don't you feel safe?")

Keybase proof

I hereby claim:

  • I am eojthebrave on github.
  • I am eojthebrave (https://keybase.io/eojthebrave) on keybase.
  • I have a public key whose fingerprint is 4C11 4573 F0EA 6437 FC8D 8ED9 68BE 7AD5 0A8C B869

To claim this, I am signing this object:

@eojthebrave
eojthebrave / gist:5e733250bbcd3fdf0c69
Created March 19, 2015 22:35
Skip external resources requested when running casperjs tests
casper.options.onResourceRequested = function(casper, requestData, request) {
// If any of these strings are found in the requested resource's URL, skip
// this request. These are not required for running tests.
var skip = [
'.kissmetrics.com',
'googleads.g.doubleclick.net',
'www.googleadservices.com'
];
skip.forEach(function(needle) {
@eojthebrave
eojthebrave / gist:05b105a1c7a95a019a42
Created May 9, 2014 14:42
Drupal 7 services module session auth with cURL
`curl http://services-demo.lan/api/v1/user/login -d '{"name":"admin","pass":"admin"}' -H "Content-type: application/json" -H "Accept: application/json"`
`curl hhttp://services-demo.lan/api/v1/system/connect -X POST`
`curl http://services-demo.lan/api/v1/system/connect -H "Cookie: SESS60f8c5b86739b7e326223b4ef35867b2=A86XHGJWlnDcMOGcArbOT-qHrsIi5P2NrcoNTXwWluw" -H "X-CSRF-Token: T77haXwD7JKOJsBlKP3p3kLbjQO96bQWvGJAE1_PUZM" -X POST`
`curl http://services-demo.lan/api/v1/user/login -X POST -H "Content-type: application/json" -H "Accept: application/json"`
@eojthebrave
eojthebrave / gist:7915294
Created December 11, 2013 17:58
Open Textual's preferences, and under the style section click "Browse style files" to start editing your textual theme. Add something like the following below. It's just CSS so you can do just about anything. There's also a JS API you can tie into.
/* Apply a background image to both the #lullabot and #drupalizeme channels */
body[channelname="#lullabot"] {
background: url(https://dl.dropboxusercontent.com/u/63787/lullalogo.png) no-repeat fixed bottom right;
}
body[channelname="#drupalizeme"] {
background: url(https://dl.dropboxusercontent.com/u/63787/dmelogo.png) no-repeat fixed center center;
}
@eojthebrave
eojthebrave / gist:7369717
Created November 8, 2013 11:28
Setup Apache Solr to work with Drupal 7.x on a Mac using homebrew.
# I did this from the root directory of our git repo. But you can probably
# do it from anywhere.
brew install solr
mkdir solr-config
cp -r /usr/local/Cellar/solr/4.5.0/libexec/example/ solr-config/
cp docroot/sites/all/modules/contrib/apachesolr/solr-conf/solr-4.x/* solr-config/solr/collection1/conf/
cd solr-conf
java -jar start.jar
@eojthebrave
eojthebrave / *.recurly.com.js
Created July 3, 2013 15:09
dotjs script for send recurly push notifications from the log on the recurly site to your callback url.
/*
Works in conjunction with dojs (https://github.com/defunkt/dotjs) to allow
passing request logged in the Recurly push notification window to a local host
without setting up port forwarding or the like.
Useful for testing push notifications on a localhost.
In order for this to work you need to add the following to the .htaccess file
of your local site otherwise you will get Cross Origin Request (CORS) errors.