Skip to content

Instantly share code, notes, and snippets.

View diegomichell's full-sized avatar

Diego Ivan Perez Michel diegomichell

View GitHub Profile
@diegomichell
diegomichell / PhotoSharingStack.ts
Created February 8, 2024 22:01
Implementing Photo Sharing Schema in CDK Typescript
import * as cdk from '@aws-cdk/core';
import * as ddb from '@aws-cdk/aws-dynamodb';
const USER_TABLE_NAME = 'Users';
const PHOTO_TABLE_NAME = 'Photos';
const COMMENT_TABLE_NAME = 'Comments';
const LIKE_TABLE_NAME = 'Likes';
const FOLLOW_TABLE_NAME = 'Follows';
export class PhotoSharingStack extends cdk.Stack {
@diegomichell
diegomichell / PhotoSharingStack.ts
Created February 8, 2024 22:00
Implementing Photo Sharing Schema in CDK Typescript
import * as cdk from '@aws-cdk/core';
import * as ddb from '@aws-cdk/aws-dynamodb';
const TABLE_NAME = 'PhotoSharing';
export class PhotoSharingStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const table = new ddb.Table(this, TABLE_NAME, {
@diegomichell
diegomichell / Program.cs
Created November 24, 2019 03:33
C# Delegates example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp
{
public delegate void OnCloseEventHandler(Modal modal);
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
class CustomPosOrder(models.Model):
_inherit = 'pos.order'
pass
# Quiero implementar sobreescribir el metodo aqui en lugar de en CustomLegacyPosOrder
class CustomLegacyPosOrder(osv.osv):
"""
Made for overriding the odoo 8 pos.order _amount_all method, so that legal tip is included in total
"""
using System;
using System.Net;
using System.Text.RegularExpressions;
/*
* Creado por: Diego Ivan Perez Michel
* Matricula: 2013-1488
*/
namespace Web
{
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Interative binary search implementation
*/
bool search(int value, int values[], int n)
{
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Interative binary search implementation
*/
bool binary_search(int value, int values[], int n)
{
/*
* Implementing Selection Sort.
*/
void sort(int values[], int n)
{
//while the list is out of order
for (int i = 0; i < n; i++)
{
int smallest = values[i];