Skip to content

Instantly share code, notes, and snippets.

View fgcoelho's full-sized avatar

Fernando Coelho fgcoelho

  • 06:49 (UTC -03:00)
View GitHub Profile
@fgcoelho
fgcoelho / smallest.bsf
Created August 31, 2025 03:09
smallest.bsf
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=
@fgcoelho
fgcoelho / telegram-miniapp-first-acess.js
Last active April 7, 2025 18:29
Telegram Miniapp first access by user webhook payload
const json = {
"update_id": 0000000000,
"message": {
"message_id": 00,
"from": {
"id": 0000000000,
"is_bot": false,
"first_name": "john",
"last_name": "doe",
"language_code": "en-us"
@fgcoelho
fgcoelho / next-og-custom-fonts.md
Last active January 31, 2025 19:09
How to properly load/handle custom fonts in Next.js Open Graph (OG) images (new ImageResponse).

How to properly load/handle custom fonts in Next.js Open Graph (OG) images (new ImageResponse).

// load-google-fonts.ts

import { ImageResponseOptions } from "next/server";

type FontOptions = ImageResponseOptions["fonts"];

async function loadGoogleFont(font: string, weight: number) {
@fgcoelho
fgcoelho / dockercompose.md
Created January 4, 2025 04:37
Install "docker compose" on AWS Linux
sudo mkdir -p /usr/local/lib/docker/cli-plugins/

sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose

sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
@fgcoelho
fgcoelho / certbot.md
Last active January 4, 2025 04:35
Docker Container + NGINX + Certbot

Originally published on October 6, 2021, on Mindsers Blog

Nginx as a server

To be able to use nginx as a server for any of our projects, we have to create a Docker Compose service for it. Docker will handle the download of the corresponding image and all the other tasks we used to do manually without Docker.

    version: '3'