Using TablePlus with Vagrant and MySQL

Moving from Sequel Pro to TablePlus I ran into an issue connecting to MySQL on a Vagrant machine.

There is a difference in how Sequel Pro and TablePlus SSH connection settings work.

Sequel Pro connection settings

Sequel Pro connection settings
Sequel Pro connection settings using SSH

Using the SSH tunnel we are able to authenticate with the ‘vagrant’ user and ~/.vagrant.d/insecure_private_key.

TablePlus connection settings

TablePlus connection settings screen
TablePlus connection using SSH

TablePlus uses a more specific connection to Vagrant. Using port 2222 and instead of using the generic key, it requires the private key that is in the specific vagrant box directory:

~/{dir to box}/.vagrant/machines/{box name}/virtualbox/private_key

  • Replace {dir to box} with the directory for the Vagrant machine
  • Replace {box name} with the name of the box

To make this easier, add the configuration to the ~/.ssh/config file by running the following command:

cd ~/{dir to box}
echo "" >> ~/.ssh/config
vagrant ssh-config >> ~/.ssh/config

It will look something like this:

Host box-name
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /{dir to box}/.vagrant/machines/box-name/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

This allows the config of TablePlus to use the “Use SSH key” and will look in the ~/.ssh/config file for it.

Getting Cypress JS to interact with CKEditor

Because .type() doesn’t submit when selecting the textarea.

CKEditor
CkEditor iframe with custom toolbar

While writing a few Cypress.io tests I ran into a problem of manipulating text in a CKEditor window.

Without diving completely into how CKEditor implements the editable iframe, my first thought was to use the native textarea field and skip adding content to the WYSIWYG all together.

Using the native type() function

// The underlying `textarea`

cy.get("#html_body")
.type("<p>HTML body</p>");

Cypress native type command
Cypress error, can’t type in hidden inputs

Cypress doesn’t like typing into hidden input element elements.

Adding the force:true config doesn’t fare much better. With Javascript turned on, CKEditor overwrites the textarea on submit and that value is lost. 😒

Cypress interacting with an iFrame

Next stop is to search “cypress type in ckeditor” which leads to the issue Cannot target elements inside of an iframe #136.

Reading through the working examples lead to something like this:

// Find the `contenteditable` element within the iframe and type

cy.get("#html_body")
  .then(function ($iframe) {
    const $body = $iframe.contents().find("body");

    cy.wrap($body[0])
      .type("<p>HTML body</p>");
  });

Cypress doesn't error
Doesn’t error, but also doesn’t submit

This does find the DOM element and says that it was typed, but it doesn’t actually result in the words being visible in the CKEditor or submitted with the form. 😢

Interacting with JS page objects

Last ditch effort is to break outside of Cypress and set the data in CKEditor natively then try to make the same call from within the Cypress test.

CKEditor has setData() and getData() functions for getting contents in and out of the editor window.

// Set the contents of the CKEditor natively on the page

CKEDITOR.instances["html_body"].setData("<p>HTML body</p>");

Now to call that from within Cypress, led to a search for “cypress get page JS objects” and then to this issue: How can I execute a JavaScript command #897 and the .window() function.

Success!

// Call out to the page window and use the CKEDITOR object

cy.window()
  .then(win => {
    win.CKEDITOR.instances["html_body"].setData("<p>HTML body</p>");
  });

Setting the content of CKEditor with Javascript
Setting the content of CKEditor with Javascript

Turning the solution into a reusable command

// Define the command

Cypress.Commands.add("type_ckeditor", (element, content) => {
  cy.window()
    .then(win => {
      win.CKEDITOR.instances[element].setData(content);
    });
});

// Use the command

cy.type_ckeditor("html_body", "<p>HTML body</p>");

With this approach it is possible to use any of the CKEDITOR.editor object functions.

Success is in partnerships

Going it alone is a recipe for failure

A university is filled with people doing incredible things. I’ve work in and around higher education professionals for 15 years. I’m constantly amazed by their ingenuity and willingness to share their lessons learned.

Enrollment Growth Hero game play

Ideas are just ideas without the support of others

“Give me six hours to chop down a tree and I will spend the first four sharpening the axe.” ~ Abraham Lincoln

Enrollment Growth Hero game play

Taking the time to shop an idea around before it is presented is required for success. Getting not only feedback from the primary audience but also anyone who will be living with its implementation.

At a college or university, enrollment initiatives can take years before results start rolling in. Because of this campuses are notoriously skeptical of ideas without legs.

Relying on outside experts can give ideas a boost. Organizations like Helix Education are in a unique spot, they interact with numerous institutions with similar goals and have been able to test and prove strategies.

Playing the game

Helix Education knows the key to success is partnerships. They know higher education so well, they created a game that speaks volumes.

They took their playbook and the struggles they’ve seen across institutions and brought it to life in a digital world you can play.

The game is really well done and even includes a secret if you’re enough of an explorer.

This is a must play for any higher education professional or anyone working at an institution that requires partnerships for an idea to be successful.

Enrollment Growth Hero

Do you have what it takes to level up your partnerships?

 

Play the Enrollment Growth Hero game and see if you have what it takes!

With this knowledge, your ideas can grow legs and allow you to run with them. Here’s to building support for your next idea!

Giving Medium a shot at living up to user expectations

Why Medium makes it to my daily reading list

Nick DeNardis Medium profile
My Medium profile

Last year I purged as many incoming requests for my attention as possible. Medium has become something I’ve adopted, enjoy and think it’s worth giving it a shot to stick around.

Video games or watching too many movies wasn’t the problem, to be honest I’ve never done much of either. It was the little things that stole my attention without even realizing it. The small things that I did habitually on a daily, hours or immediate basis that forced me to become deliberate about my time.

Things I’ve purged checking daily

  • Instagram, Twitter, Facebook timelines
  • HTML email newsletters
  • Push notification for basically anything on my phone

Things that have stood the test of time

  • Email marked as Primary
  • Nuzzle email digest
  • Quora email digest
  • Medium digest
  • Podcasts while driving/running

Medium is for stories, how to’s and personality

Personal stories, interviews and experiences define how opinions are shaped and Medium sets the perfect environment for these stories.

I’ve tried Pocket, Instapaper, and various other tools to strip away the cruft from sites to create the ideal reading environment. Medium accomplishes this without requiring me to leave the site.

Content curation on the Medium homepage and email have been spot on and they promise to make it better. For me it’s the combination of recommendations by friends, popular items from topics I follow and a few off the wall stories that I wouldn’t have searched out myself. This mix has made it feel far less like typical sites that focus on a descending list of popular articles, but more like a personalized newsletter.

Writing/cross promoting content on Medium

Many OG blogger, including myself, believe my content isn’t safe long term on Medium. They are profiting from me and if they shut down tomorrow all my content and following go *poof* without a way to redirect.

I still maintain my own domain, blog, and email list for content ownership but like others, attention and discovery are slim. The few articles I have posted to Medium include the standard “Originally posted at…” final line to let people know I am more than Medium articles.

This fear is something that Medium should embrace, it means people are putting hard work into the content they produce here. They don’t consider it throw away content and are conscious about their investment.

Hope for the future

I have hope that Medium will do the right thing and embrace content creators and consumers genuinely to squash these fears. I’m giving Medium a chance to succeed and you should too. It will be pretty clear in a few months with how many people vote with their feet (dollars).

edUi 2017 analytics workshop announced – September 25-27, 2017

edUi conference

edUi is a conference for web professionals working at institutions of learning—colleges, universities, libraries, and museums.

2017 location

September 25-27
Charlottesville, VA at 3 venues on the scenic pedestrian mall in downtown

One half-day workshop is included with every edUi registration at no additional charge. Everyone who wants a workshop at edUi gets a workshop. When registration opens up in April you’ll have your pick of one of three fantastic, in-depth, hands-on workshops including the following.

Analytics workshop

At edUi 2017 Nick DeNardis will lead a half-day workshop on how to get the most out of your analytics.

Using web analytics, Google Tag Manager, and A/B Testing, you’ll learn how to optimize your digital channels to understand what’s working and what’s not. This comprehensive, hands-on workshop will cover the basics of creating and implementing an analytics and digital measurement strategy.

Call for proposals

The call for proposals is open now through March 22, 2017

  • Everyone who submits a proposal gets a 10% discount on their registration.
  • Accepted speakers will receive a complimentary registration.

Registration

Registration for edUi 2017 will open in April.

Ticket prices

  • Early Bird: $550
  • Standard: $675

Follow additional updates:

Facebook | Twitter | Blog