Skip to content

Instantly share code, notes, and snippets.

View BaezCrdrm's full-sized avatar

Samuel Báez BaezCrdrm

  • Mexico
View GitHub Profile
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@BaezCrdrm
BaezCrdrm / docker-compose.yml
Created February 16, 2023 00:45
Docker compose for keycloak and mariadb
version: '3'
# References
# # https://stackoverflow.com/a/60554189/5424025
services:
mysql:
image: docker.io/mariadb:10
environment:
MARIADB_DATABASE: dbkc
@BaezCrdrm
BaezCrdrm / README.md
Last active October 7, 2022 16:11
Express JS init using TypeScript

Dependencies installer

This script will help to install the (my) basic dependencies and Development dependencies for an ExpressJS based project using TypeScript.

How to use

$ chmod +x dep_installer.sh
$ ./dep_installer.sh [options] <path to project>
@BaezCrdrm
BaezCrdrm / Info.md
Created September 6, 2022 15:07
React VS Code debugger
@BaezCrdrm
BaezCrdrm / basic-text-recognition.ipynb
Last active January 4, 2022 21:43
Reconocimiento básico de texto en una imagen
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BaezCrdrm
BaezCrdrm / example.service
Created May 24, 2021 16:56
Systemd service
[Unit]
Description="Service name"
[Service]
ExecStart=/usr/bin/node <Entry file -> index.js>
WorkingDirectory=<Path to project>
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
@BaezCrdrm
BaezCrdrm / README.md
Last active May 4, 2021 22:23
CORS Node.js, Express y WebApp

CORS

Los errores de CORS son muy comunes de encontrar cuando se construye una WebApp. Para más conocimiento de qué es CORS, pueden acceder a este enlace CORS. Este tipo de errores se puede manejar desde el servidor sobre el cual se está realizando la petición.

Node.js y Express

En el archivo principal index.js podrán realizar la configuración correspodiente para manejar el acceso de los clientes.

  1. Establecer la lista de clientes permitidos.
const allowedOrigins = [
@BaezCrdrm
BaezCrdrm / ServidorTCP.cs
Created November 6, 2020 22:44
Ejemplo de servidor sencillo TCP
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace SocketCom
{
public class ServidorTCP
{
public TcpListener escucha { get; set; }
@BaezCrdrm
BaezCrdrm / Dockerfile
Created October 12, 2020 21:04
Dockerfile .NET Core
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["ProjectName.csproj", "./"]
@BaezCrdrm
BaezCrdrm / Docker toolbox MYSQL connection.md
Last active February 8, 2020 22:59
Docker toolbox MYSQL connection