Skip to content

Instantly share code, notes, and snippets.

View chicho69-cesar's full-sized avatar
:octocat:
I'm programing!!

Cesar Villalobos Olmos chicho69-cesar

:octocat:
I'm programing!!
View GitHub Profile

Instalar Docker en Ubuntu

Instale algunos paquetes de requisitos previos que permitan a apt usar paquetes a través de HTTPS:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Luego, añada la clave de GPG para el repositorio oficial de Docker en su sistema:

@chicho69-cesar
chicho69-cesar / index.js
Last active September 16, 2023 14:39
JavaScript memoization
// memoization
const memo = (fn) => {
const memory = {}
return (key) => {
if (memory[key]) {
console.log('Extracting of the memory')
return memory[key]
}
@chicho69-cesar
chicho69-cesar / config-connection.js
Created June 20, 2023 20:33
Conexion a una base de datos en MongoDB con Mongoose
require('colors');
const mongoose = require('mongoose');
const dbConnection = async () => {
try {
await mongoose.connect(process.env.MONGODB_CNN, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false
@chicho69-cesar
chicho69-cesar / extensiones.md
Last active April 20, 2024 14:34
Extensiones que uso en VS Code

Nest Logo

Mis extensiones en VS Code

Esta es una lista con las extensiones que utilizo hasta el momento en Visual Studio Code

@chicho69-cesar
chicho69-cesar / using_dio.dart
Created December 17, 2022 21:02
Using Dio package to get the response from an api rest in flutter
import 'package:dio/dio.dart';
Future getHttp() async {
try {
var response = await Dio().get('http://www.google.com');
print(response);
} catch (e) {
print(e);
}
}
@chicho69-cesar
chicho69-cesar / cors.cs
Created September 19, 2022 22:44
Como habilitar los CORS en una API hecha con ASP.NET minimal API's
string CORS = "My CORS";
builder.Services.AddCors(options => {
options.AddPolicy(name: CORS, builderCors => {
builderCors.SetIsOriginAllowed(origin => new Uri(origin).Host == "localhost")
.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin();
});
});