Skip to content

Instantly share code, notes, and snippets.

View thomasmassmann's full-sized avatar
👨‍💻

Thomas Massmann thomasmassmann

👨‍💻
View GitHub Profile
@thomasmassmann
thomasmassmann / index.ts
Last active January 12, 2025 09:11
capacitor-barcode-scanner web patch
/**
* Patch for the `@capacitor/barcode-scanner` plugin for web.
* This is related to
* https://github.com/ionic-team/capacitor-barcode-scanner/issues/50
*
* This patch registers a new plugin for Capacitor that provides a fixed
* web implementation of the barcode scanner.
*
* The plugin is named `CapacitorBarcodeScannerPatchWeb` and only contains
* the web version. For iOS and Android, the original plugin needs to be used.
/Volumes/Work/Personal/Plone/Core/plone5devel 5.2> ./bin/instance fg  ✓  11:37:39
ImportError: PyCapsule_Import could not import module "Acquisition"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./bin/instance", line 272, in <module>
+ sys.argv[1:]))
File "/Volumes/Work/Configurations/buildout/shared-eggs/plone.recipe.zope2instance-6.7.2-py3.7.egg/plone/recipe/zope2instance/ctl.py", line 944, in main
options.realize(args, doc=__doc__)
# -*- 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
# -*- 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

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:

@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>
<?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">[email protected]</xsl:param>
[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:[email protected]
@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.
@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;