Skip to content

Instantly share code, notes, and snippets.

View kimpepper's full-sized avatar

Kim Pepper kimpepper

View GitHub Profile
@kimpepper
kimpepper / gist:5695139
Created June 2, 2013 22:07
Re-install drupal 8
# re-install drupal 8
dsi8() {
sudo rm -rf sites/default/files/* && sudo chmod 777 sites/default/files && drush si standard --sites-subdir=default -y && drush dis overlay -y && drush en devel simpletest -y && sudo chmod -R 777 sites/default/files && drush uli
}
Leto ~/dev/osr/app(14210-2nd-level-landing %): dr vget panelizer
panelizer_defaults_node_landing_page_2nd_level: array (
'status' => 1,
'view modes' =>
array (
'page_manager' =>
array (
'status' => 1,
'default' => 1,
'choice' => 0,
/**
* Plugins are described by creating a $plugin array which will be used
* by the system that includes this file.
*/
$plugin = array(
'title' => t("Landing Page context from node context"),
'keyword' => 'landingpage',
'description' => t('Adds a Landing Page context from existing node context.'),
'required context' => new ctools_context_required(t('Node'), 'node'),
'context' => 'osr_landingpage_context_from_node_context',
@kimpepper
kimpepper / gist:5754130
Last active December 18, 2015 08:29
plugin definition
<?php
function osr_landingpage_context_ctools_plugin_directory($module, $plugin) {
if ($module == 'ctools' && $plugin == 'relationships') {
return 'plugins/relationships';
}
}
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP Fatal error: Class name must be a valid object or a string in /Users/kim/dev/uts/uts-site/app/includes/common.inc on line 7749
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP Stack trace:
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 1. {main}() /Users/kim/dev/uts/uts-site/app/index.php:0
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 2. menu_execute_active_handler() /Users/kim/dev/uts/uts-site/app/index.php:21
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 3. drupal_deliver_page() /Users/kim/dev/uts/uts-site/app/includes/menu.inc:532
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 4. drupal_deliver_html_page() /Users/kim/dev/uts/uts-site/app/includes/common.inc:2544
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 5. drupal_render_page() /Users/kim/dev/uts/uts-site/app/includes/common.inc:2656
[Tue Jul 16 14:15:02 2013] [error] [client 127.0.0.1] PHP 6. admin_menu_page_build()
$conf['solr_host_overrides'] = array(
'uts_solr' => array(
'name' => 'UTS (local)',
'options' => array(
'host' => '127.0.0.1',
'port' => '8983',
'path' => 'solr/uts',
'http_user' => '',
'http_pass' => '',
),
@kimpepper
kimpepper / gist:6245571
Created August 15, 2013 22:31
Run phing from a sub-directory
ph() {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/build.xml" ]]; do
path=${path%/*}
done
(cd $path && phing $@)
}
@kimpepper
kimpepper / gist:6325336
Created August 24, 2013 00:53
Re-install drupal 8 with drush
# re-install drupal 8
dsi8() {
sudo rm -rf sites/default/files/* && sudo chmod 777 sites/default/files && drush si standard --sites-subdir=default --uri="http://drupal-8.dev" -y && drush dis overlay -y && drush en devel simpletest -y && sudo chmod -R 777 sites/default/files && drush --uri=http://drupal-8.dev:80 uli
}
<?php
namespace Drupal\menu_block;
use Drupal\Core\Cache\CacheBackendInterface;
class MenuBlockRepository implements MenuBlockRepositoryInterface {
public function getMenus() {
// something here.
<?php
/**
* Example page callback.
*/
function _menu_example_page_callback() {
return "This is some content";
}