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.md
Created October 13, 2022 04:22 — forked from erral/index.md
How to deploy Volto sites automatically in non-docker scenarios
@macagua
macagua / semantic-branch-names.md
Created October 12, 2022 14:38 — forked from seunggabi/semantic-branch-names.md
semantic-branch-names.md

Semantic Branch Names

See how a minor change to your branch name style can make you a better programmer.

Format: <type>/#<issueNumber>-<alias>

Example

@macagua
macagua / semantic-commit-messages.md
Created October 12, 2022 14:38 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@macagua
macagua / doodba_cheatsheet.md
Last active September 19, 2022 18:44 — forked from michaelkarrer81/doodba_cheatsheet.md
[doodba tools] doodba tools and commands #doodba #odoo #docker #invoke #pre-commit

Installation

This project itself is just the template, but you need to install these tools to use it:

@macagua
macagua / letsencrypt_2020.md
Created September 21, 2021 04:18 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@macagua
macagua / Makefile
Created September 1, 2021 14:46 — forked from rsperl/Makefile #snippet
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)