Skip to content

Instantly share code, notes, and snippets.

thamas / get-own-ip
Last active Dec 28, 2015
Get own IP address
View get-own-ip
curl -l; echo
thamas /
Last active Aug 29, 2015
Make custom CSS classes work with Drupal WYSIWYG 7.x-2.2 and CKEditor 4.3.3

I use it to set img floats. To make it work

  1. be sure to define at least one inline element class (when you defined your image float classes), for examle Emphasize=span.emph
  2. add a "cache-buster" to the end of the path of you css file: /sites/all/themes/mytheme/css/style.css?v1 (the "chache-buster" is the "?v1" at the end of the path. More info:
thamas / Get back your Drupal install-profile
Last active Aug 29, 2015
Sometimes Drupal forgots about your install-profile. To fix:
View Get back your Drupal install-profile
drush vset install_profile 'profile-name'

This is not a straight translation of the lirycs but the English version of the song.

More info about the musical, The Attic:ás

Light years

There are days when I feel
I could leave this whole tangled World behind
I look for an answer
But another question is all I find


This is a translation of "Az álom leterít" – a song from the former Hungarian blues band, called "Stexas"*

Dream is hunting me

Headlight drills through the night.
Then it disappears in the fog
It was't here maybe.

Oh I can only see your eyes shine,
and a parting word of your mouth,

View menu-raw.html
<a href="/" data-drupal-link-system-path="<front>">Frontpage</a>
<a href="/about" data-drupal-link-system-path="node/1">About us</a>
<a class="is-active" href="/team" data-drupal-link-system-path="node/2">Team</a>
View menu-with-classes.html
<ul class="c-menu-main">
<li class="c-menu-main__item">
<a href="/" class="c-menu-main__link" data-drupal-link-system-path="<front>">Frontpage</a>
<li class="c-menu-main__item c-menu-main__item--expanded c-menu-main__item--active-trail">
<a href="/about" class="c-menu-main__link" data-drupal-link-system-path="node/1">About us</a>
<ul class="c-menu-main__submenu">
<li class="c-menu-main__item c-menu-main__item--active-trail">
<a href="/team" class="c-menu-main__link is-active" data-drupal-link-system-path="node/2">Our team</a>
View twig-debug-mode-output.html
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'menu__main' -->
* menu--main.html.twig
x menu.html.twig
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/navigation/menu.html.twig' -->
View menu.html.twig
{% import _self as menus %}
We call a macro which calls itself to render the full tree.
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
thamas / menu.html.twig
Created Apr 29, 2016
menu_name passed as argument
View menu.html.twig
{{ menus.menu_links(items, attributes, 0, menu_name) }}
{% macro menu_links(items, attributes, menu_level, menu_name) %}