Skip to content

Instantly share code, notes, and snippets.

View LewisW's full-sized avatar

Lewis LewisW

  • UK
View GitHub Profile
#!/bin/bash
#--
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@LewisW
LewisW / docker-direct-lvm.sh
Last active November 19, 2015 11:11 — forked from ambakshi/docker-direct-lvm.sh
docker-direct-lvm
#!/bin/bash
set -e
## striping seems to break docker
#STRIPE="-i2 -I64"
#DEVS="/dev/xvdf /dev/xvdg"
DEVS="$1"
if [ -z "$DEVS" ]; then
echo >&2 "Specify which block devices to use"
exit 1
@LewisW
LewisW / example_usage.html.twig
Created December 8, 2014 12:52
Twig macro for mapping a mime type to a font-awesome icon.
{% import 'Path:To:filemacros.html.twig' as file %}
<span class="fa {{ file.icon(attachment.file.mimeType) }}"> </span>
<!-- Solution brought to you by Caroline Schnapp -->
<!-- See this: http://wiki.shopify.com/Related_Products -->
{% assign number_of_related_products_to_show = 3 %}
{% assign image_size = 'compact' %}
{% assign heading = 'Other fine products' %}
{% capture number_of_related_products_to_fetch %}{{ number_of_related_products_to_show | plus: 1 }}{% endcapture %}
{% if collection == null or collection.handle == 'frontpage' or collection.handle == 'all' %}
@LewisW
LewisW / NextTabGroup.PHPEditAction
Created April 5, 2012 12:51
Moves to the next tab group in PHPEdit
$groups = P::$UserInterface->DocumentWindows->Pane1Groups;
$i = 0;
$found_group = false;
// Loop through each group
foreach ($groups as $group) {
if ($group->Windows->IndexOf(P::$UserInterface->DocumentWindows->ActiveWindow) > -1) {
$found_group = $i;
}