Skip to content

Instantly share code, notes, and snippets.

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

Tony G. Bolaño tonybolanyo

🏠
Working from home
View GitHub Profile
@tonybolanyo
tonybolanyo / cypress.json
Created July 20, 2020 11:45
How to install and configure cucumber and cypress on angular project
{
"integrationFolder": "./e2e/features",
"pluginsFile": "./e2e/plugins/index.js"
}
@tonybolanyo
tonybolanyo / policy.json
Created April 3, 2020 09:39 — forked from koladilip/policy.json
Cognito Identity Pool Authenticated Role Policy to Upload to S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
@tonybolanyo
tonybolanyo / Commit Formatting.md
Created March 27, 2020 19:46 — forked from brianclements/Commit Formatting.md
Angular Commit Format Reference Sheet

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the AngularJS change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@tonybolanyo
tonybolanyo / command.sh
Created March 5, 2020 14:51
Extract SVG from ttf font using fontforge
fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' foo.ttf
@tonybolanyo
tonybolanyo / yarn.private.registry.md
Created January 23, 2020 15:58
Yarn con registro privado
  1. Configurar la autenticación para que se mantenga a lo largo de los diferentes comandos
yarn config set always-auth true
  1. Hacer login en el registro de paquetes
yarn login --registry http://...
@tonybolanyo
tonybolanyo / duplicate_db.sql
Created January 23, 2020 09:06
Duplicate database in postgres using psql
-- Impide crear nuevas conexiones a la base de datos que usaremos como plantilla
UPDATE pg_database SET datallowconn = false WHERE datname = 'original_database';
-- Cierra todas las conexiones existentes (excepto la actual)
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'albacete' AND pid <> pg_backend_pid();
-- Crea la nueva base de datos utilizando la base de datos original como plantilla
CREATE DATABASE albacete_beta WITH TEMPLATE albacete OWNER devpostgres;
-- Permite de nuevo conexiones a la base de datos de origen
UPDATE pg_database SET datallowconn = true WHERE datname = 'original_database';
@tonybolanyo
tonybolanyo / howto-docker-ubuntu-18.04
Last active November 6, 2021 01:26
Instalar docker y docker-compose en ubuntu 18.04
# Instalar docker
First, update your existing list of packages:
```
sudo apt update
```
Next, install a few prerequisite packages which let apt use packages over HTTPS:
@tonybolanyo
tonybolanyo / howto.md
Created December 9, 2019 12:16
Install docker on Ubuntu 18.04

Instalar docker

Primero, actualice su lista de paquetes existente:

sudo apt update

A continuación, instale algunos paquetes de requisitos previos que le permiten a apt usar paquetes mediante HTTPS:

@tonybolanyo
tonybolanyo / .npmrc
Last active September 29, 2019 07:16
Develop system settings: VS Code, npm defaults
init.author.name=Tony G. Bolaño
init.author.email=tonybolanyo@gmail.com
init.author.url=https://tonygb.com
init.license=MIT
@tonybolanyo
tonybolanyo / api.js
Created September 15, 2019 11:00
JWT authentication handler using Axios interceptors. It refreshes access token on the fly when backend API throws out a 401 error. Multiple requests at the same time supported.
import axios from 'axios';
import JWTDecode from 'jwt-decode';
import { AuthApi } from './auth.api';
import { config } from '../config';
const { API_ENDPOINT } = config[process.env.NODE_ENV];
axios.defaults.baseURL = API_ENDPOINT;
axios.defaults.timeout = 7000;