Skip to content

Instantly share code, notes, and snippets.

View alexalvess's full-sized avatar
🏚️
Working from home

Alex Alves alexalvess

🏚️
Working from home
View GitHub Profile
@alexalvess
alexalvess / publish_pkg.yml
Created July 3, 2024 17:44
Prepare and Publish a NPM Package
name: Publish to NPM
on:
pull_request:
types: [closed]
branches:
- '**'
jobs:
create_tag_and_release:
@alexalvess
alexalvess / collector-agent.yml
Created June 27, 2024 09:13
Observability stack
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
exporters:
otlp:
endpoint: "collector-gateway:4320"
insecure: true
@alexalvess
alexalvess / IMongoDBContext.ts
Created July 18, 2023 17:16
Configure Projections operation
import * as Mongoose from "mongoose";
import { IDisposable } from "../../../../../../utils/idisposable";
export interface IMongoDbContext extends IDisposable {
getColletion<TSchema extends Mongoose.AnyObject = Mongoose.AnyObject>(collectionName: string): Mongoose.Collection<TSchema>;
}
@alexalvess
alexalvess / vss-manifest.json
Created January 15, 2021 12:52
vss-manifest.json
{
"manifestVersion": 1,
"id": "task-702d7430-c3a9-422a-87f2-569ed16ba6be",
"name": "Coverage API",
"version": "0.0.1",
"publisher": "AlexAlves",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
@alexalvess
alexalvess / index_total_func.ts
Created January 15, 2021 00:09
index total func
import * as Request from "request";
const xml2js = require("xml2js");
const fs = require("fs");
const task = require("azure-pipelines-task-lib/task");
const parser = new xml2js.Parser({ attrkey: "ATTR" });
async function run() {
try {
const apiUrl = task.getInput("ApiUrl", true);
@alexalvess
alexalvess / index_func.ts
Created January 14, 2021 23:51
index func
import * as Request from "request";
const xml2js = require("xml2js");
const fs = require("fs");
const task = require("azure-pipelines-task-lib/task");
const parser = new xml2js.Parser({ attrkey: "ATTR" });
async function run() {
/// ... code
}
@alexalvess
alexalvess / index_imports.ts
Created January 14, 2021 23:48
index ts imports
import * as Request from "request";
const xml2js = require("xml2js");
const fs = require("fs");
const task = require("azure-pipelines-task-lib/task");
const parser = new xml2js.Parser({ attrkey: "ATTR" });
@alexalvess
alexalvess / task.json
Last active January 14, 2021 23:28
custom task json
{
"$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
"id": "702d7430-c3a9-422a-87f2-569ed16ba6be",
"name": "APICoverageTest",
"friendlyName": "API Coverage Test",
"description": "Test coverage according to tested endpoints and what's in the swagger. Only support for JUnit test format.",
"helpMarkDown": "",
"category": "Test",
"author": "Alex Alves",
"version": {
@alexalvess
alexalvess / AppTenant.cs
Created December 7, 2020 22:45
appTenant entity
public class AppTenant
{
public AppTenant(string registerNumber)
{
RegisterNumber = registerNumber;
}
public string RegisterNumber { get; }
}
[Route("api/[controller]")]
[ApiController]
public class BusinessController : ControllerBase
{
// ... some code
[HttpPost]
[Route("authorAndUser")]
public async Task<IActionResult> InsertAuthorAndUser([FromBody] CreateAuthorAndUserModel authorAndUserModel)
{