Skip to content

Instantly share code, notes, and snippets.

@mikeyp
mikeyp / honeybadger.module
Created June 21, 2013 22:55
Lets play a game. Do you think it's possible to un-check "Emergency" on the settings form, and save that change?
<?php
/**
* Form builder for settings form.
*/
function honeybadger_settings_form($form, &$form_state) {
$form['honeybadger_api_key'] = array(
'#type' => 'textfield',
'#title' => t('Honeybadger.io API key'),
'#default_value' => variable_get('honeybadger_api_key'. ''),
section#main,
header,
footer {
.container {
@include outerRow();
}
}
header,
footer {
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>
<?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;
}
}
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)
<a href="#" class="read-more">Read more</a>
<?php
/**
* @file
* Fake db statement wrapper to make mssql_query work more like PDO.
*/
/**
* Class FakePDO
*/
@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'
(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()
}
};
source "http://rubygems.org"
# Gems
gem 'nanoc'
gem 'adsf'
gem 'kramdown'
gem 'compass'
# Guard support
gem 'guard'