Skip to content

Instantly share code, notes, and snippets.

import appinsights from 'applicationinsights';
import winston from 'winston';
import { transports, format, Logger } from 'winston';
// Configura Application Insights
appinsights.setup(process.env.APPINSIGHTS_INSTRUMENTATIONKEY)
.setAutoCollectConsole(false)
.start();
const aiClient = appinsights.defaultClient;
Analytics Analytics/Analytics.puml
Athena Analytics/Athena.puml
AthenaDataSourceConnectors Analytics/AthenaDataSourceConnectors.puml
CleanRooms Analytics/CleanRooms.puml
CloudSearch Analytics/CloudSearch.puml
CloudSearchSearchDocuments Analytics/CloudSearchSearchDocuments.puml
DataExchange Analytics/DataExchange.puml
DataExchangeforAPIs Analytics/DataExchangeforAPIs.puml
DataPipeline Analytics/DataPipeline.puml
DataZone Analytics/DataZone.puml
terraform {
required_version = ">= 1.0.0"
backend "s3" {}
required_providers {
aws = {
source = "hashicorp/aws"
version = "= 4.63.0"
configuration_aliases = [aws.alternate]
# Create the whole infrastructure to run the Strapi CMS webserver
# and the static frontend that uses nextjs.
# Terraform provider configuration
variable "db_name" {
description = "The name of the database"
default = "my_database"
}
@gunzip
gunzip / refactor.ts
Last active August 9, 2022 16:59
refactor using io-ts types
import { identity, pipe } from "fp-ts/lib/function";
import * as E from "fp-ts/lib/Either";
import * as t from "io-ts";
import { WithinRangeInteger } from "./numbers";
const _isNonEmptyUint8Array = (u: unknown): u is Uint8Array =>
Array.isArray(u) && u.length > 0 && t.array(WithinRangeInteger(0, 256)).is(u);
export const NonEmptyUint8Array = new t.Type<Uint8Array, Uint8Array, unknown>(
"NonEmptyUint8Array",
import { pipe } from "fp-ts/lib/function";
import * as E from "fp-ts/lib/Either";
import * as t from "io-ts";
import { WithinRangeInteger } from "./numbers";
export const NonEmptyUint8Array = new t.Type<Uint8Array, String, Array<number>>(
"NonEmptyUint8Array",
(u): u is Uint8Array =>
t.array(WithinRangeInteger(0, 256)).is(u) && u.length > 0,
(u, c) =>
@gunzip
gunzip / mobile.test.ts
Last active September 30, 2021 07:29
MobileNumberT
import { isRight } from "fp-ts/lib/Either";
import { MobileNumberFromString, PatternString } from "../strings";
describe("MobileNumberFromString", () => {
it("should fail", () => {
const ps = MobileNumberFromString.decode("ABCD");
expect(isRight(ps)).toBeFalsy();
});
it("should success", () => {
const ps = MobileNumberFromString.decode("123456789");

Comunicazione & progettazione

  • limitare l'utilizzo della comunicazione sincrona (slack) per q&a
  • partire dai doc gdrive per l'analisi dei requisiti, inserire lì i commenti e taggare le persone che possono rispondere
  • durante la standup howdy alla domanda 'hai bisogno di aiuto' taggare le stesse persone per sollecitare una risposta
  • usare le storie su pivotal per discutere l'implementazione quando i requisiti sono chiari
  • usare le PR per discutere i dettagli implementativi
  • inserire eventualmente dei commenti inline nelle PR per spiegare alcune scelte progettuali (non dovrebbe essere necessario se si usano bene i commenti nel codice :-)
/**
* we need a couple of patches and some utility functions
* to the azure sdk, see
* https://github.com/teamdigitale/io-developer-portal-backend/tree/master/patches
*/
// tslint:disable:no-console
import * as dotenv from "dotenv";
dotenv.config({ path: __dirname + "/../local.env" });
import ApiManagementClient from "azure-arm-apimanagement";
@gunzip
gunzip / test.ts
Created November 25, 2019 13:09
taskeither
import { array } from "fp-ts/lib/Array";
import { left2v, taskEither, tryCatch } from "fp-ts/lib/TaskEither";
const t1 = tryCatch<Error, string>(
// some function that returns a promise or an either
async () => "someValue1",
// "catch" handler
() => Error("t1 error")
);