Skip to content

Instantly share code, notes, and snippets.

View kevinah95's full-sized avatar
🇨🇷

Kevin A. Hernández Rostrán kevinah95

🇨🇷
View GitHub Profile
using AutoMapper;
using AutoMapper.Internal;
using MappingObjects.Models;
namespace MappingObjects.Mappers;
public static class CartToSummaryMapper
{
public static MapperConfiguration GetMapperConfiguration()
{
builder.Services.AddSwaggerGen(opt =>
{
opt.SwaggerDoc("v1", new OpenApiInfo { Title = "MyAPI", Version = "v1" });
opt.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
Description = "Please enter token",
Name = "Authorization",
Type = SecuritySchemeType.Http,
BearerFormat = "JWT",
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace APIConBD.Entities;
[Table("Todos")]
public partial class Todo
{
[Key]
public int Id { get; set; }
@kevinah95
kevinah95 / Author.cs
Last active October 17, 2024 01:47
Lección 02
using System.Runtime.Serialization;
namespace SoapCore_Demo
{
[DataContract]
public class Author
{
[DataMember]
public int Id { get; set; }
[DataMember]
public string FirstName { get; set; }
@kevinah95
kevinah95 / arquitectura-01.yml
Created November 28, 2023 01:02
arquitectura-01.yml
AWSTemplateFormatVersion: 2010-09-09 # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html
Resources:
PrimerInstancia:
Type: AWS::EC2::Instance
Properties:
AvailabilityZone: us-east-1
ImageId: ami-00f8146d2a74d4b4e
InstanceType: t2.micro
Tags:

Add eslint and prettier

https://eslint.org/blog/2023/10/deprecating-formatting-rules/

$ npm init @eslint/config
✔ How would you like to use ESLint? · problems
✔ What type of modules does your project use? · esm
✔ Which framework does your project use? · react
✔ Does your project use TypeScript? · No / Yes
@kevinah95
kevinah95 / lab03.sh
Last active September 26, 2023 22:41
#!/bin/bash
# Install Apache Web Server and PHP
dnf install -y httpd wget php mariadb105-server
# Download Lab files
wget https://aws-tc-largeobjects.s3.us-west-2.amazonaws.com/CUR-TF-100-ACCLFO-2/2-lab2-vpc/s3/lab-app.zip
unzip lab-app.zip -d /var/www/html/
# Turn on web server
chkconfig httpd on
service httpd start
dotnet ef dbcontext scaffold "DataSource=Northwind.db" Microsoft.EntityFrameworkCore.Sqlite -o Models
def hourglassSum(arr):
results = []
max_value = 0
for j in range(4):
sums = []
for i in range(5):
sum_01 = sum(arr[j][i : 3 + i])
sum_02 = arr[j + 1][i + 1]
sum_03 = sum(arr[j + 2][i : 3 + i])
sums.append(sum_01 + sum_02 + sum_03)