Skip to content

Instantly share code, notes, and snippets.

View LionsAd's full-sized avatar

Fabian Franz LionsAd

  • LionsAd
  • Schweiz
View GitHub Profile
@LionsAd
LionsAd / breadcrumb.twig
Created October 7, 2012 17:42 — forked from mortendk/breadcrump.twig
twig loops
<nav class="breadcrumb" role="navigation">
<h2 class="element-invisible">{{ 'You are here'|t }}</h2>
<ol>
{% for item in breadcrumb %}
{% if loop.first %}
<li class="first">{{ item }}</li>
{% elseif loop.last %}
<li class="last">{{ item }}</li>
{% else %}
<li>{{ item }}</li>
@LionsAd
LionsAd / breadcrump.twig
Created October 7, 2012 18:07 — forked from psynaptic/breadcrump.twig
twig breadcrumbs
{% if breadcrumb is defined %}
<nav class="breadcrumb" role="navigation">
<h2 class="element-invisible">{{ 'You are here'|t }}</h2>
<ol>
{% for item in breadcrumb %}
{% if loop.last %}
<li>{{ item }}</li>
{% else %}
<li>{{ item }} » </li>
{% endif %}
@LionsAd
LionsAd / breadcrump.twig
Created October 7, 2012 18:16 — forked from mortendk/breadcrump.twig
twig breadcrumbs
{#
/**
* @file
* Returns HTML for a breadcrumb trail.
*
* @param $variables
* An associative array containing:
* - breadcrumb: An array containing the breadcrumb links.
*
* @ingroup themeable
@LionsAd
LionsAd / layout-2col.html.twig
Created October 12, 2012 01:20 — forked from EclipseGc/gist:3876811
The 2col template in twig
{#
/**
* @file
* Template for a 2 column layout.
*
* This template provides a two column display layout, with each column
* roughly equal in width.
*
* Variables:
* - attributes: Attributes to use for the layout like additional classes and id.
<?php
/**
* @file
*
* Contains Drupal\newsletter_view\Controller\NewsletterViewNodeController
*/
namespace Drupal\newsletter_view\Controller;
@LionsAd
LionsAd / spectre-thread.c
Last active February 21, 2019 17:42 — forked from ErikAugust/spectre.c
Spectre example code - using threads and showing detailed statistics
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */