Skip to content

Instantly share code, notes, and snippets.

View m4olivei's full-sized avatar

Matthew Oliveira m4olivei

  • Lullabot
  • Grimsby, Ontario
View GitHub Profile
@m4olivei
m4olivei / instructions.md
Last active August 10, 2016 02:14 — forked from mikeyp/instructions.md
PHPStorm and Drupal 8

Development

Enabling PHPStorm Support

PHPStorm 8 supports most D8 features including Twig templates, container links, namespaces etc. To enable full support:

  1. Log into the admin section at localhost:8888/user.
  2. Make sure that the following plugins are enabled:
@m4olivei
m4olivei / function.js
Last active October 31, 2016 18:17 — forked from wesruv/function.js
Clean CSS identifier from string
// In a perfect world, you'd never have to do this. Wish I lived in a perfect world.
/**
* Convert a string to a usable class name
* @param {string} stringToConvert String of text
* @return {string} Usable class name
*/
function convertStringToClassName(stringToConvert) {
if (typeof stringToConvert === 'string') {
return stringToConvert.trim().replace(/[\s-_]+/g, '-').replace(/[^\w-]|^-|-$/g, '').replace(/-+(?=-)/, '').toLowerCase();