Skip to content

Instantly share code, notes, and snippets.

View tiberiuichim's full-sized avatar
🎯
Focusing

Tiberiu Ichim tiberiuichim

🎯
Focusing
View GitHub Profile
@tiberiuichim
tiberiuichim / volto-sandbox.rst
Created February 10, 2023 10:32 — forked from rnixx/volto-sandbox.rst
Create and install an environment for volto development on a linux machine (debian based)

How to bootstrap a volto project

Install Node package manager (npm). It is the tool required to install JavaScript packages and libraries:

sudo apt install npm

Install Node version manager (nvm). Volto frontend requires a Node.js server for resource delivery and server side rendering. Node version manager is a tool which helps running the version of Node.js required by Volto:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
class SubformsTransformer(object):
order = -100 # this should to be executed as first as possible
block_type = None
iface = None
def __init__(self, context, request):
self.context = context
self.request = request
def _transform(self, blocks):
@tiberiuichim
tiberiuichim / test-volto-master.md
Created September 9, 2020 08:37
How to develop Volto and test it in a project

This a description of the workflow I use to be able to test fresh Volto code in a local Volto project:

  • Basically I use yalc for this. https://github.com/whitecolor/yalc
  • Install it with npm i yalc -g
  • In your copy of Volto (git clone https://github.com/plone/volto if you don't have one) run: yalc publish
  • In your Volto project (created with create-volto-app), run: yalc add @plone/volto --no-pure

This will create a local copy of Volto in your project. If you need to "refresh" the copy, run yalc add @plone/volto --no-pure again.

The advantage of this method is that you can have a proper separate Volto, which you can use to push commits and Pull Requests to plone/volto, and you can test these changes in your local project.

Registration of adapter:

  <subscriber factory=".blocks.TextBlockConverter" provides="plone.restapi.interfaces.IBlockDeserializer" />

What it looks like:

@implementer(IBlockDeserializer)
@adapter(IBlocks, IBrowserRequest)
diff --git a/eea/rdfmarshaller/dexterity/modifiers.py b/eea/rdfmarshaller/dexterity/modifiers.py
index 157c5a4..e19d26b 100644
--- a/eea/rdfmarshaller/dexterity/modifiers.py
+++ b/eea/rdfmarshaller/dexterity/modifiers.py
@@ -1,13 +1,16 @@
""" Modifiers """
import re
import sys
-import rdflib
-from Products.CMFCore.WorkflowCore import WorkflowException
@tiberiuichim
tiberiuichim / TopicModelZoo.md
Created April 30, 2019 15:04 — forked from scapegoat06/TopicModelZoo.md
Topic Model Zoo
<!DOCTYPE html>
<!-- saved from url=(0074)http://discomap.eea.europa.eu/Trial/ROLF/sitemap/overview-2015-birgit.html -->
<html style="height:100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Untitled</title>
<!--Adobe Edge Runtime-->
@tiberiuichim
tiberiuichim / rename.py
Created April 27, 2018 13:23 — forked from david-batranu/rename.py
Rename and move Plone/Zope objects without triggering events
portal = app['Plone']
catalog = portal['portal_catalog']
src = portal['src_folder']
dst = portal['dst_folder']
orig = [
'name1',
#!/usr/bin/env python2
""" experimentation with surf.rdflib API """
from __future__ import print_function
import logging
import pprint
from datetime import datetime