Skip to content

Instantly share code, notes, and snippets.

@mvsantos
mvsantos / remove-image-background.sh
Created May 10, 2013 14:16
Remove/strip image background - rough mode - requires ImageMagick
# Requires ImageMagick
# Converting the source from JPEG to PNG - if necessary
convert my_src_image.jpg my_src_image.png
# Option A
# - Requires a temporary intermediate file
# - Drill more than 10 might result in poor results
#!/bin/sh -e
# git-cache-meta -- file owner and permissions caching.
# Based on the solution proposed by <jidanni @ jidanni.org> found at
# http://thread.gmane.org/gmane.comp.version-control.git/104971/focus=105133
IFS=$'\n' # avoid problems when finding spaces in file names
: ${GIT_CACHE_META_FILE=.git_cache_meta}
@mvsantos
mvsantos / start-mock-smtp.sh
Last active June 8, 2017 13:36
Start a mock smtp server which can be useful for local dev environment and may also be bundled into a Docker image
#!/usr/bin/env bash
# Authors: Marcos Santos, 2017
# License: MIT
# This script starts a mock smtp server and stores the emails "sent" in a local
# directory (i.e. /tmp/smtp-sink ).
# This comes in handy when running tests on a dev environment.
#
# This script requires the binary smtp-sink which is normally shipped within
#!/usr/bin/env bash
# Immediately exit this script if ..
# any internal command exits with non-zero status
set -o errexit
# any unbound variables are used
set -o nounset
# any pipe fails
set -o pipefail
# Generate CSR and KEY
openssl req -nodes -newkey rsa:2048 -nodes -keyout www.key -out www.csr \
-subj "/C=GB/ST=Greater London/L=London/O=Example Ltd./OU=example.com/CN=www.example.com"
openssl req -in www.csr -noout -text
openssl rsa -in www.key -noout -text
# Send CSR to certificate issuer to get a new certifificate
# Verify issued certificate: www.crt
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
__DIR__="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OPENREFINE_VERSION=${OPENREFINE_VERSION:-3.1}
INSTALL_PATH="${INSTALL_PATH:-${HOME}/.openrefine}"
@mvsantos
mvsantos / bump-version-tag.sh
Last active August 9, 2022 16:34
Bump a git repo semver tag.
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
__THIS_FILE__="$(basename "${BASH_SOURCE[0]}")"
SEMVER_REGEX="^[vV]?(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z]+){0,1}$"
SEMVER_MAJOR=0
@mvsantos
mvsantos / PRODUCT_STANDARDS.md
Created August 24, 2020 09:07
SaaS product development: language and style guide

THIS IS NOT A STARTER DOCUMENT. THESE ARE NAPKIN SCRIBBLES.

Vocabulary

Sign in, Sign in to

Avoid: Login, sign-in, sign in, sign into,

Sign up, sign up to

JIRA Sprints

Only issues which are in the last column on your board will be considered done by the Scrum board. And therefore any ticket not in the last column may not count towards burn up/down reports.

Tickets waiting for review/QA may linger around for long and due to bottlenecks and aren’t completed by the Sprint closing time.

Are QA and PR review being considered when a task is estimated? Common trend: QA bottlenecks towards the end of the Sprint.

Infra requirements - e.g. setup new clusters, procurement of services, etc - may lead to delays and therefore they must be brought up to the attention of a key stakeholder as early as possible before they become a blocker.

@mvsantos
mvsantos / jira-quick-filters-jql.md
Last active February 11, 2023 21:57
Collection of Jira JQL

URGENT

(priority IN (Critical, High) OR (duedate >= "-7d" AND duedate <= "7d"))

Blocked

Flagged IS NOT EMPTY

Bugs