Skip to content

Instantly share code, notes, and snippets.

View FilipBartos's full-sized avatar

Filip Bartoš FilipBartos

View GitHub Profile
@FilipBartos
FilipBartos / axios-response-interceptor.js
Last active April 11, 2024 07:03
Axios response interceptor for access token refresh supporting 1 to N async requests
let isAlreadyFetchingAccessToken = false
let subscribers = []
function onAccessTokenFetched(access_token) {
subscribers = subscribers.filter(callback => callback(access_token))
}
function addSubscriber(callback) {
subscribers.push(callback)
}
@FilipBartos
FilipBartos / template.yaml
Last active April 12, 2021 10:55
CloudFormation template to redirect naked (apex) domain to full domain
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Redirecting naked (apex) domain to full domain example
Parameters:
DomainName:
Description: Naked (apex) name of the domain
Type: String
Certificate:
@FilipBartos
FilipBartos / docker-compose.yml
Last active May 22, 2021 07:39
Running Wordpress in Docker
version: "3.9"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@FilipBartos
FilipBartos / docker-compose.yml
Created May 1, 2022 13:22
MySQL with phpMyAdmin in Docker
version: '3'
services:
mysql:
image: mysql:8.0
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: root-password
MYSQL_DATABASE: database
MYSQL_USER: user