Skip to content

Instantly share code, notes, and snippets.

View msonnabaum's full-sized avatar

Mark Sonnabaum msonnabaum

  • Lithic
  • San Diego, CA
View GitHub Profile
This file has been truncated, but you can view the full file.
C TIME(us) FILE DELTA(us) -- FUNC
1 11678172476 autoload.php 2 -> main
1 11678172531 autoload_real.php 54 -> main
1 11678172560 autoload_real.php 29 <- main
1 11678172600 autoload_real.php 39 -> getLoader
1 11678172655 autoload_real.php 55 -> loadClassLoader
1 11678172717 ClassLoader.php 62 -> main
1 11678172743 ClassLoader.php 25 <- main
1 11678172767 autoload_real.php 24 <- loadClassLoader
1 11678172834 include_paths.php 67 -> main
#!/bin/sh
for FILE in $@
do
TYPE=`file -b $FILE`
if [ "${FILE##*.}" != "csv" -o "$TYPE" != "ASCII text" ]
then
echo "$FILE is not a csv file!"
exit 1
fi
<?php
function menu_render_no_access_checks($menu_name) {
$menu = _menu_build_tree($menu_name, array('max_depth' => 1));
// Copy/paste from menu_navigation_links
foreach ($menu['tree'] as $item) {
if (!$item['link']['hidden']) {
$class = '';
$l = $item['link']['localized_options'];
<?php
/**
* @file
* Definition of Drupal\Core\Cache\ArrayBackend.
*/
namespace Drupal\Core\Cache;
/**
<?php
foreach (array_keys(views_get_all_views()) as $view) {
$view = views_get_view($view);
$view->display['default']->display_options['cache'] = array('type' => "none");
foreach ($view->display as $display_name => $display) {
$view->display[$display_name]->display_options['cache'] = array('type' => "none");
}
$view->save();
node.set.elasticsearch.plugins = {
"mobz/elasticsearch-head" => {},
"lukas-vlcek/bigdesk" => {},
"royrusso/elasticsearch-HQ" => {}
}
<?php
class ContentEntityFormController extends EntityFormController {
public function getFormLangcode(array &$form_state) {
if (empty($form_state['langcode'])) {
$form_state['langcode'] = $this->entityManager()->getTranslationFromContext($this->entity)->language()->id;
}
return $form_state['langcode'];
#!/usr/bin/env ruby
require 'fileutils'
require 'shellwords'
def php_file_contents(filename)
open(filename).to_a
end
def fix_entity_paths(file_contents)
file_contents.map do |line|
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
register_shutdown_function(function () {
$namespace = 'sitename';
$filename = '/tmp/' . uniqid() . '.' . $namespace . '.xhprof';
file_put_contents($filename, serialize(xhprof_disable()));
});
name: Bartik
type: theme
description: 'A flexible, recolorable theme with many regions and a responsive, mobile-first layout.'
package: Core
version: VERSION
core: 8.x
stylesheets:
all:
- css/layout.css
- css/style.css