Skip to content

Instantly share code, notes, and snippets.

View macagua's full-sized avatar
🏠
Working from home

Leonardo J. Caballero G. macagua

🏠
Working from home
View GitHub Profile
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
@Grab(group='joda-time', module='joda-time', version='2.7')
import wslite.rest.*
import org.joda.time.*
import org.joda.time.format.*
import groovy.xml.*
import groovy.json.*
import static java.lang.System.*
import groovy.transform.*
@macagua
macagua / taiga.md
Created June 14, 2023 17:06 — forked from cham11ng/taiga.md
Taiga Integration

Taiga Integration

First: Configure the integration module in Taiga

  1. Go to Admin > Integrations > GitHub or Bitbucket
  2. Fill secret key or use the auto generated one
  3. Copy the payload URL input

Second: Configure Webhooks in your GitHub repository

  1. Click on Settings > Webhooks & Services > Add webhook
  2. On that screen set the payload url with the payload url from Taiga
@macagua
macagua / ipynb_to_gallery.py
Created April 26, 2023 22:04 — forked from chsasank/ipynb_to_gallery.py
Convert jupyter notebook to sphinx gallery notebook styled examples.
@macagua
macagua / upsert.py
Created April 1, 2023 22:25 — forked from vanpelt/upsert.py
Flask SqlAlchemy MySQL ON DUPLICATE KEY UPDATE returning auto increment id UPSERT HOTNESS
from app import db
from sqlalchemy import func
from sqlalchemy.dialects.mysql import insert
def upsert(model, insert_dict):
"""model can be a db.Model or a table(), insert_dict should contain a primary or unique key."""
inserted = insert(model).values(**insert_dict)
upserted = inserted.on_duplicate_key_update(
id=func.LAST_INSERT_ID(model.id), **{k: inserted.inserted[k]
for k, v in insert_dict.items()})
@macagua
macagua / index.html
Created October 2, 2018 14:12
AdminLTE 2 Dashboard Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="https://adminlte.io/themes/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
@macagua
macagua / BOBTEMPLATES_ODOO.rst
Last active February 27, 2023 20:58
Bob Template for create addon to Odoo v15

bobtemplates.odoo

El paquete bobtemplates.odoo proporciona plantillas de mr.bob para generar paquetes para proyectos de addon para Odoo.


Instalar bobtemplates.odoo

@macagua
macagua / Instalar Plone 5.2.11 en Linux.rst
Last active February 20, 2023 16:24
Instalación de Plone 5.2.11 en Linux con zc.buildout usando el proyecto training_buildout

Instalar dependencias

Actualizar dependencias base de Linux, ejecutando los siguientes comandos:

sudo apt-get update && sudo apt-get upgrade -y

Ubuntu

@macagua
macagua / BOBTEMPLATES.rst
Last active February 16, 2023 13:57
Instalación de bobtemplates para Plone 5.2.11

bobtemplates.plone

El paquete bobtemplates.plone proporciona plantillas de mr.bob para generar paquetes para proyectos de Plone.


Instalar bobtemplates.plone

@macagua
macagua / fixblobs.py
Created August 25, 2014 23:09
A Zope command line script to delete content with missing BLOB in Plone
"""
A Zope command line script to delete content with missing BLOB in Plone, causing
POSKeyErrors when content is being accessed or during portal_catalog rebuild.
Tested on Plone 4.1 + Dexterity 1.1.
http://stackoverflow.com/questions/8655675/cleaning-up-poskeyerror-no-blob-file-content-from-plone-site
Also see:
@macagua
macagua / index.md
Created October 13, 2022 04:22 — forked from erral/index.md
How to deploy Volto sites automatically in non-docker scenarios