Skip to content

Instantly share code, notes, and snippets.

@cbeier
cbeier / gist:1669002
Created January 24, 2012 09:05
Settings for Environment Indicator module
/**
* Settings for Environment Indicator module
*
* Text:
* - DEVELOPMENT ENVIRONMENT
* - STAGING ENVIRONMENT
* - PRODUCTION ENVIRONMENT
*
* Color (based on http://ethanschoonover.com/solarized):
* - Development: #268bd2
@cbeier
cbeier / gist:2787268
Created May 25, 2012 10:47
Field Formatter to add an Read More Link in text body
/**
* Implements hook_field_formatter_info().
*/
function hook_field_formatter_info() {
return array(
// The 'summary or trimmed' field formatter for text_with_summary
// fields displays returns the summary element of the field or, if
// the summary is empty, the trimmed version of the full element
// of the field.
// If the Read More link option is used, a link will be placed after
@cbeier
cbeier / .bashrc
Created November 2, 2012 08:51
Drush and Drush Make on DomainFactory Managed Server
alias drush='~/drush/drush'
alias php='/usr/local/bin/php5-53STABLE-CLI'
export DRUSH_PHP=/usr/local/bin/php5-53STABLE-CLI
@cbeier
cbeier / gist:f331eeb3a99db1c35646
Last active October 15, 2015 21:02
Drupal 7: Debug Query
<?php
function debug_query($query) {
$querystring = $query->__toString();
$querystring = str_replace("{", '', $querystring);
$querystring = str_replace("}", '', $querystring);
foreach ($query->getArguments() as $key => $item) {
if (!$item) {
$item = 'NULL';
@cbeier
cbeier / DebugQuery.php
Last active August 15, 2017 11:00
Drupal 8: Debug Database Query
<?php
namespace Drupal\YOURNAMESPACE\Helper;
use Drupal\Core\Database\Query\SelectInterface;
class DebugQuery {
/**
* Debug a database query and print it out.
@cbeier
cbeier / drupal.conf
Last active February 22, 2017 14:17 — forked from podarok/drupal.conf
server {
server_name yourserver.com www.yourserver.com;
root /usr/share/nginx/www/drupal;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
location = /favicon.ico {
log_not_found off;
access_log off;
}