Skip to content

Instantly share code, notes, and snippets.

View andrewfairlie's full-sized avatar

Andrew Fairlie andrewfairlie

View GitHub Profile
vcl 4.0;
backend default {
.host = "127.0.0.1"; # The domain or IP address of your ExpressionEngine Site
.port = "8080"; # The port of your EE site. In production, Varnish should be on port 80, so consider changing your Apache server to port 8080
.probe = {
.url = "/";
.timeout = 1000ms;
.interval = 1s;
.window = 10;
@andrewfairlie
andrewfairlie / goodfeedback.md
Last active November 9, 2015 14:03
Good Feedback
{% if block|length>1 %}
{
"role": "gallery",
"layout": "galleryLayout",
"behavior": {
"type": "parallax",
"factor": 0.8
},
"items": [
{% for image in block %}
{# Define our macro #}
{% macro card(title,content) %}
<div class="card">
<h2>{{ title }}</h2>
{{ content }}
</div>
{% endmacro %}
{# Import the macro, here we use _self but usually it'll be a separate file #}
{% import _self as ui %}
{# Define our macro #}
{% macro card(title,content,img,url) %}
{% if url %}<a href="{{ url }}">{% endif %}
<div class="card">
{% if img %}<img src="{{ img }}">{% endif %}
<h2>{{ title }}</h2>
{{ content }}
</div>
{% if url %}</a>{% endif %}
{{ ui.card('Card Title','Hello World',null,null) }}
{# Define our macro #}
{% macro card(attributes) %}
{% if attributes.url %}<a href="{{ attributes.url }}">{% endif %}
<div class="card">
{% if attributes.img %}<img src="{{ attributes.img }}">{% endif %}
<h2>{{ attributes.title }}</h2>
{{ attributes.content }}
</div>
{% if attributes.url %}</a>{% endif %}
{# Define our macro #}
{% macro card(attributes) %}
{% set defaults = {
scheme: 'light',
size: 'standard'
} %}
{# Merge our two arrays together #}
{% set attributes = defaults|merge(attributes) %}
{% for randomFact in craft.entries.section('fact').order('RAND()').one() %}
{
"speech": "{{ randomFact.fact }}",
"displayText": "{{ randomFact.fact }}"
}
{% set randomFact = craft.entries.section('fact').order('RAND()').one() %}
{
"fulfillmentText": "{{ randomFact.fact }}"
}