Skip to content

Instantly share code, notes, and snippets.

@thamas
thamas / get-own-ip
Last active Dec 28, 2015
Get own IP address
View get-own-ip
curl -l http://echoip.net; echo
@thamas
thamas / css-class-drupal-wysiwyg-cke.md
Last active Aug 29, 2015
Make custom CSS classes work with Drupal WYSIWYG 7.x-2.2 and CKEditor 4.3.3
View css-class-drupal-wysiwyg-cke.md

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: http://chipcullen.com/how-to-apply-classes-ckeditor-4-in-drupal-7/)
@thamas
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'
View light_years.md

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

More info about the musical, The Attic: http://en.wikipedia.org/wiki/A_padlá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

View dream_is_hunting_me.md

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
<ul>
<li>
<a href="/" data-drupal-link-system-path="<front>">Frontpage</a>
</li>
<li>
<a href="/about" data-drupal-link-system-path="node/1">About us</a>
<ul>
<li>
<a class="is-active" href="/team" data-drupal-link-system-path="node/2">Team</a>
</li>
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>
<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>
</li>
View twig-debug-mode-output.html
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'menu__main' -->
<!-- FILE NAME SUGGESTIONS:
* 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.
@see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
@thamas
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) %}