Skip to content

Instantly share code, notes, and snippets.

View marianocodes's full-sized avatar
🚀

Mariano Alvarez marianocodes

🚀
View GitHub Profile
@marianocodes
marianocodes / contribuciones-a-comunidad.md
Last active June 7, 2020 02:00
Contribuciones a la comunidad (ES)

Mariano Alvarez - Contribuciones a la comunidad

Angular Costa Rica (Co-Fundador y Co-Organizador)

Mes a mes, organizamos eventos en línea, siguiendo la dinámica de tener un presentador nacional y otro internacional. Como parte del esfuerzo de compartir conocimiento sobre Angular, uno de nuestros objetivo en la comunidad es poder generar más contenido en español y alentar a las personas a seguir aprendiendo y que vayan más allá sin que el inglés sea un impedimento.

Social Networks:

@marianocodes
marianocodes / community-contributions.md
Last active January 27, 2022 14:17
My contributions to the community that has given me a lot <3

Mariano Alvarez - Community Contributions

Angular Costa Rica (Co-Founder and Co-Organizer)

I'm one of the founders and co-organizers of Angular Community in Costa Rica. Every month, We organize an online event with one national and one international speaker.

As part of the effort of sharing knowledge about Angular, one of our goals in the community is to generate content in Spanish to encourage people to continue learning about it and go beyond the language barrier.

Social Networks:

@marianocodes
marianocodes / curls.sh
Created June 3, 2019 03:36
Convector with NestJS - curls
# Add a new person
curl -H "Content-Type: application/json" --request POST --data '{ "id":"1-00200-2222-1", "name":"John Doe" }' http://localhost:8000/person
# Add a new attribute
curl -H "Content-Type: application/json" --request POST --data '{ "attributeId":"birth-year", "content": 1993 }' http://localhost:8000/person/1-00200-2222-1/add-attribute
@marianocodes
marianocodes / api-test.sh
Created June 1, 2019 17:56
Convector with NestJS - API.sh
curl http://localhost:3000/participant/gov
curl http://localhost:3000/participant/mit
@marianocodes
marianocodes / seed.ssh
Last active June 3, 2019 03:34
Convector with NestJS - seed.ssh
# Start a local blockchain
npm run env:restart
# Install the chaincode
npm run cc:start -- person
# Start your web server
npx lerna run start:dev --scope server --stream
# Seed some participants
@marianocodes
marianocodes / convector.ts
Last active May 30, 2019 01:54
Convector with NestJS - convector.ts
import { Logger } from '@nestjs/common';
import { FabricControllerAdapter } from '@worldsibu/convector-adapter-fabric';
import { ClientFactory } from '@worldsibu/convector-core';
import * as fs from 'fs';
import { ParticipantController, Participant } from 'participant-cc';
import { PersonController } from 'person-cc';
import { join, resolve } from 'path';
import { keyStore, identityName, channel, chaincode, networkProfile, identityId } from './env';
@marianocodes
marianocodes / env.ts
Last active June 10, 2019 21:01
Convector with NestJS - env
import * as dotenv from 'dotenv';
dotenv.config();
// tslint:disable-next-line:no-var-requires
const homedir = require('os').homedir();
export const chaincode = process.env.CHAINCODE || 'person';
export const channel = process.env.CHANNEL || 'ch1';
@marianocodes
marianocodes / person.controller.ts
Last active May 30, 2019 02:04
Convector with NestJS - person.controller.ts
import { Body, Controller, Get, Logger, HttpException, HttpStatus, Post, Param } from '@nestjs/common';
import { Person } from 'person-cc';
import { PersonService } from './person.service';
import { PersonControllerBackEnd } from '../convector';
@Controller('person')
export class PersonController {
constructor(public personService: PersonService) { }
@marianocodes
marianocodes / participant.service.ts
Created May 29, 2019 05:54
Convector with NestJS - person.service.ts
import { Injectable, Logger } from '@nestjs/common';
import { Person, Attribute } from 'person-cc';
import { couchDBView, identityId } from '../env';
import { PersonControllerBackEnd } from '../convector';
@Injectable()
export class PersonService {
public async getAll() {
@marianocodes
marianocodes / participant.controller.ts
Last active May 30, 2019 02:04
Convector with NestJS - Participant Controller
import { Controller, Get, Param, Logger, HttpException, HttpStatus } from '@nestjs/common';
import { ParticipantControllerBackEnd } from '../convector';
@Controller('/participant')
export class ParticipantController {
@Get(':id')
public async getHello(@Param('id') id: string) {
try {
return await ParticipantControllerBackEnd.get(id);