Skip to content

Instantly share code, notes, and snippets.

@mikeyp
mikeyp / path_audit.drush.inc
Created July 29, 2014 22:19
Find out what item corresponds to a specific path
<?php
/**
* @file
* Provide Drush integration for finding menu router items.
*/
/**
* Implements hook_drush_help().
*/
function path_audit_drush_help($section) {
mikey-p ~: time lunchy restart memcached
stopped homebrew.mxcl.memcached
started homebrew.mxcl.memcached
real 0m0.128s
user 0m0.085s
sys 0m0.040s
source "http://rubygems.org"
# Gems
gem 'nanoc'
gem 'adsf'
gem 'kramdown'
gem 'compass'
# Guard support
gem 'guard'
(function (e, a, h, f, c, b, d) {
c = a.createElement("script");
c.type = "text/javascript";
c.src = "https://rawgithub.com/marmelab/gremlins.js/master/gremlins.min.js";
c.onload = c.onreadystatechange = function () {
if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
h();
f(c).remove()
}
};
@mikeyp
mikeyp / Gemfile
Last active January 3, 2016 14:59
source 'https://rubygems.org'
gem 'compass'
gem 'zurb-foundation'
gem 'guard-compass'
gem 'guard-livereload'
<?php
/**
* @file
* Fake db statement wrapper to make mssql_query work more like PDO.
*/
/**
* Class FakePDO
*/
<a href="#" class="read-more">Read more</a>
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)
<?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;
}
}
Global options (see `drush topic core-global-options` for the full list):
-d, --debug Display even more information, including internal messages.
-h, --help This help system.
-n, --no Assume 'no' as answer to all prompts.
-r <path>, --root=<path> Drupal root directory to use (default: current directory).
-s, --simulate Simulate all relevant actions (don't actually change the system).
-l <http://example.com:8888>, URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).
--uri=<http://example.com:8888>