Skip to content

Instantly share code, notes, and snippets.

Michael Prasuhn mikeyp

Block or report user

Report or block mikeyp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikeyp
mikeyp / instructions.md
Created Aug 9, 2016
PHPStorm and Drupal 8
View instructions.md

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:
View -
diff --git a/composer.json b/composer.json
index 4aeec9e..244b773 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
"repositories": [
{
"type": "composer",
- "url": "https://packagist.drupal-composer.org"
+ "url": "https://packages.drupal.org/8"
View gist:5aa538425801893f2c9432b1b4504aae
<?xml version="1.0"?>
<root>
<item>
<name>Remap Left Control to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps Left Control to Control + Shift + Option + Command.</appendix>
<identifier>space_cadet.left_control_to_hyper</identifier>
<autogen>
--KeyToKey--
@mikeyp
mikeyp / 0_reuse_code.js
Created Apr 28, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Gemfile
source 'https://rubygems.org'
gem 'compass'
gem 'zurb-foundation'
gem 'guard-compass'
gem 'guard-livereload'
View FakePDO.php
<?php
/**
* @file
* Fake db statement wrapper to make mssql_query work more like PDO.
*/
/**
* Class FakePDO
*/
View markup.html
<a href="#" class="read-more">Read more</a>
View phpunit
mdp ~/www/8/core (8.x): time ./vendor/bin/phpunit tests/Drupal/Tests/Core/Access/AccessManagerTest.php
PHPUnit 3.7.21 by Sebastian Bergmann.
Configuration read from /Users/mdp/www/8/core/phpunit.xml.dist
........................
Time: 0 seconds, Memory: 6.25Mb
OK (24 tests, 99 assertions)
View gist:6993726
<?php
protected function get_entity_type() {
$class = get_class($this);
$types = entity_get_info();
foreach ($types as $entity_type => $info) {
if (isset($info['entity class']) && $class == $info['entity class']) {
return $entity_type;
}
}
View _layout.scss
section#main,
header,
footer {
.container {
@include outerRow();
}
}
header,
footer {
You can’t perform that action at this time.