Esta es una lista con las extensiones que utilizo hasta el momento en Visual Studio Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string CORS = "My CORS"; | |
builder.Services.AddCors(options => { | |
options.AddPolicy(name: CORS, builderCors => { | |
builderCors.SetIsOriginAllowed(origin => new Uri(origin).Host == "localhost") | |
.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:dio/dio.dart'; | |
Future getHttp() async { | |
try { | |
var response = await Dio().get('http://www.google.com'); | |
print(response); | |
} catch (e) { | |
print(e); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// memoization | |
const memo = (fn) => { | |
const memory = {} | |
return (key) => { | |
if (memory[key]) { | |
console.log('Extracting of the memory') | |
return memory[key] | |
} |