This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\YOURNAMESPACE\Helper; | |
use Drupal\Core\Database\Query\SelectInterface; | |
class DebugQuery { | |
/** | |
* Debug a database query and print it out. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias drush='~/drush/drush' | |
alias php='/usr/local/bin/php5-53STABLE-CLI' | |
export DRUSH_PHP=/usr/local/bin/php5-53STABLE-CLI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Settings for Environment Indicator module | |
* | |
* Text: | |
* - DEVELOPMENT ENVIRONMENT | |
* - STAGING ENVIRONMENT | |
* - PRODUCTION ENVIRONMENT | |
* | |
* Color (based on http://ethanschoonover.com/solarized): | |
* - Development: #268bd2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Ersetze template mit dem Namen deines Templates | |
template_preprocess_node(&$variables) { | |
$variables['content']['body]['#items'][0]['summery']['#prefix'] = '<p>; | |
$variables['content']['body]['#items'][0]['summery']['#prefix'] = '</p>; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Redaxo Modul Aktion für die Erweiterung der möglichen Datenfelder | |
// Zuordnung der Redaxo Aktion zum entsprechenden Modul nicht vergessen! ;) | |
// Presave/Postsave-Action (jeweils in das Textfeld einfügen) | |
<?php | |
$newname = ""; | |
for ($c=0;$c<99;$c++) | |
$newname .= $rexname[$c]."~"; | |
if ($REX_ACTION[VALUE][1] != "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bugfix for line-height bug on sup/sub element | |
* | |
* @bugfix | |
* @affected IE 5.x/Win, IE6, IE7 | |
* @css-for IE 5.x/Win, IE6, IE7 | |
* @yalid yes | |
*/ | |
html sup, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def age(birthday) | |
y = Date.today.year - birthday.year | |
m = Date.today.month - birthday.month | |
d = Date.today.day - birthday.day | |
case | |
when m < 0 | |
age = y-1 | |
when m = 0 | |
case | |
when d = 0 |
NewerOlder