Skip to content

Instantly share code, notes, and snippets.

View thomasmassmann's full-sized avatar
👨‍💻

Thomas Massmann thomasmassmann

👨‍💻
View GitHub Profile
@thomasmassmann
thomasmassmann / buildout.cfg
Created November 30, 2012 18:11
Dynamic haproxy backends with buildout
[buildout]
backends = 4
parts =
myapp
client
haproxy-build
haproxy-config
supervisor
@thomasmassmann
thomasmassmann / Vagrantfile
Last active August 26, 2018 00:24
Create a vagrant box with chef server provisioning and automatic client and node cleanup on the server when the vagrant box gets destroyed. All necessary api keys and config options are taken from environment variables. The knife.rb must live inside a .chef directory besides the Vagrantfile.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'chef'
Chef::Config.from_file(File.join(File.dirname(__FILE__), '.chef', 'knife.rb'))
vms = {
"testbox" => {
:box => "precise64",
:ipaddress => "192.168.33.10",
@thomasmassmann
thomasmassmann / chef.conf
Last active December 11, 2015 23:18
Install a chef server on debian with fabric.
upstream chef_server {
server 127.0.0.1:4000 fail_timeout=0;
}
upstream chef_server_webui {
server 127.0.0.1:4040 fail_timeout=0;
}
server {
listen 443 default ssl;
@thomasmassmann
thomasmassmann / zodb_download.yml
Last active August 19, 2016 13:25
Manage Plone database backups with ansible.
---
- name: Download a copy of the ZODB and blobstorage.
hosts: plone-db
gather_facts: true
tasks:
- name: Get current date and time.
[theme]
title = Your Theme
description = A Theme.
preview = preview.png
doctype = <!DOCTYPE html>
[theme:parameters]
portal_url = portal_state/portal_url
header = string:normal
email = string:info@example.com
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- The empty params defined here will be overridden by your manifest.cfg. -->
<xsl:param name="portal_url"></xsl:param>
<xsl:param name="header">normal</xsl:param>
<xsl:param name="email">info@example.com</xsl:param>
@thomasmassmann
thomasmassmann / deco_bootstrap_2.xml
Created August 28, 2017 10:30
Transform Deco Grid to Bootstrap 2
<!-- Transform Deco (Sunburst Theme) grid into Bootstrap 2 grid. -->
<replace content="//div[contains(@class,'cell')]">
<div>
<xsl:copy-of select="attribute::*[not(name()='class')]" />
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test='@class[contains(.,"width-1:4")]'>span3</xsl:when>
<xsl:when test='@class[contains(.,"width-1:3")]'>span4</xsl:when>
<xsl:when test='@class[contains(.,"width-1:2")]'>span6</xsl:when>
<xsl:when test='@class[contains(.,"width-2:3")]'>span8</xsl:when>

Keybase proof

I hereby claim:

  • I am thomasmassmann on github.
  • I am thomasmassmann (https://keybase.io/thomasmassmann) on keybase.
  • I have a public key ASBSMhul9vlYrKIcgNOsGaWvuPi7PA9cXKDXrAlpVlZjfQo

To claim this, I am signing this object:

# -*- coding: utf-8 -*-
"""Collection tiles."""
from Acquisition import aq_inner
from plone.app.contenttypes.behaviors.collection import ICollection
from plone.app.standardtiles import PloneMessageFactory as PMF # noqa: N814
from plone.app.standardtiles.contentlisting import IContentListingTileLayer
from plone.subrequest.interfaces import ISubRequest
from plone.supermodel.model import Schema
from plone.tiles import Tile
# -*- coding: utf-8 -*-
"""Customizations for plone.app.mosaic."""
from operator import itemgetter
from plone.app.mosaic.interfaces import IMosaicRegistryAdapter
from plone.app.mosaic.registry import getCategoryIndex
from plone.app.mosaic.registry import MosaicRegistry
from plone.registry.interfaces import IRegistry
from Products.CMFCore.interfaces._content import IFolderish
from zope.component import adapter