Skip to content

Instantly share code, notes, and snippets.

View FelipeBarrosCruz's full-sized avatar

Felipe Barros Cruz FelipeBarrosCruz

View GitHub Profile
import structlog
structlog.configure(
processors=[
structlog.processors.TimeStamper(fmt="iso"),
structlog.processors.add_log_level,
structlog.processors.EventRenamer("msg"),
structlog.processors.JSONRenderer(),
]
)
swagger: "2.0"
info:
description: "StoneLog Reverse API to connect with logistic services"
version: "1.0.0"
title: "StoneLog Reverse API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
const nameKey = 'numero'
const quantityKey = 'qtd'
const product = [1, 1, 2, 2, 2, 3, 4, 5, 5]
const reduced = product.reduce((acc, num) => ({
...acc,
[num.toString()]: ((acc && acc[num] || 0) + 1)
}), {})
const formated = Object.keys(reduced).map((num) => ({
const NEW_VALUE = 1
const forms = document.querySelectorAll('form')
const save = ({ input, submit }) => new Promise(async(resolve, reject) => {
try {
input.value = NEW_VALUE
await submit.click()
resolve()
} catch (err) {
reject(err)
import { PipeTransform, Pipe } from '@angular/core';
improt { isPlainObject } from 'lodash';
@Pipe({ name: 'keys' })
export class KeysPipe implements PipeTransform {
transform(value, args: string[]): Array<String> | null {
if (!isPlainObject(value)) {
return null;
}
return Object.keys(value);
  • Falhas de processo, inexperiencia, cases de dificuldade

    • Experiencias sobre tentar implementar a filosofia de microservicos (componentes) de forma arcaica com API's end-to-end com uma comunicação feita por um cliente HTTP
    • Dificuldade de estruturar a arquitetura
    • Dificuldade de manter o codigo e integrações
  • Historia e filosofia

    • Era dos Componentes
    • Filosofia de microserviço
    • Responsabilidade unica
function Plugin () {
const seneca = this
const MergeValidate = require('btime-merge-validate-package')
const mergeValidate = MergeValidate(seneca)
const PICK_FIELDS = [
'field'
]
seneca.add({ role: 'plugin', cmd: 'create' }, cmd_create)

curl -L http://goo.gl/Zu98AA

  <html>
    <head>
      <title>
        CTF Nível básico
      </title>
      <meta charset="utf-8">
    </head>
    <body>
<?php
return [
"database" => [
"host" => "localhost"
]
];
import { first, find } from 'lodash'
export interface IGeoLocationModel {
lat: string
lng: string
country: string
parseGoogleMapResponse(result: object): void
}
export class GeoLocationModel implements IGeoLocationModel {