Skip to content

Instantly share code, notes, and snippets.

View demarant's full-sized avatar

Antonio De Marinis demarant

View GitHub Profile
@demarant
demarant / haystack-demo.py
Created December 13, 2020 21:55
streamlit app demo for haystack
import streamlit as st
import requests
from annotated_text import annotated_text
st.set_page_config(
page_title="Haystack - Ask me something and get an answer!",
page_icon=":crown:",
layout="centered",
initial_sidebar_state="auto",
)
Verifying my Blockstack ID is secured with the address 1GnQPuVgqwt8Gh2jCiv27YhNU5sEtF3XMn https://explorer.blockstack.org/address/1GnQPuVgqwt8Gh2jCiv27YhNU5sEtF3XMn
@demarant
demarant / bulkUpdateRoleMappings
Created March 22, 2014 22:25
Update permissions for objects (give list of brains) in multi transactions, needed when you change the workflow permissions and you have many objects affected
def bulkUpdateRoleMappings(self,brains=None, transaction_size=20):
""" Update permissions for objects from brains in transactions
"""
context = self
if brains is None:
brains = []
totobs = len(brains)
info('starting update role mappings for %s objects' % str(totobs))
counter = 0
portal_workflow = getToolByName(context, 'portal_workflow', None)