Skip to content

Instantly share code, notes, and snippets.

View fabriciofmsilva's full-sized avatar

Fabrício Silva fabriciofmsilva

View GitHub Profile
@fabriciofmsilva
fabriciofmsilva / project.md
Created May 24, 2019 22:36
Projects Idea
  • Logging system
  • Message queue
  • O/R mapping layer
  • ETL
  • Job scheduler / work queue
@fabriciofmsilva
fabriciofmsilva / architecture.md
Last active May 24, 2019 21:00
An Incremental Architecture Approach to Building Systems

Starting with some form of a monolith and ending up with a set of microservices.

If you don’t end up regretting your early technology decisions, you probably overengineered.

In the idea phase: What problem are we trying to solve?

  • Find a business model
  • Find a product market fit
  • Acquire our first customers
@fabriciofmsilva
fabriciofmsilva / di.md
Created May 24, 2019 19:12
DI Framework

This is where DI frameworks can help. A DI framework generally provides two pieces of functionality:

  1. A mechanism for “providing” new components. In a nutshell, this tells the DI framework what other components you need to build yourself (your dependencies) and how to build yourself once you have those components.
  2. A mechanism for “retrieving” built components.

A DI framework generally builds a graph based on the “providers” you tell it about and determines how to build your objects. This is very hard to understand in the abstract, so let’s walk through a moderately-sized example.

@fabriciofmsilva
fabriciofmsilva / solo.md
Created May 6, 2019 21:28
Good Engineering Practices while Working Solo

A quick note about “working solo”

  • An open-source project, such as a package or library
  • A personal product, which could be commercial or free
  • A freelance gig for a client

Why should I bother about my engineering practices?

You’ll be an asset to your team.

@fabriciofmsilva
fabriciofmsilva / Store.js
Created May 6, 2019 18:31
Finally understand Redux by building your own Store
// Reference: https://ultimatecourses.com/blog/redux-typescript-store
export class Store {
private subscribers: Function[];
private reducers: { [key: string]: Function };
private state: { [key: string]: any };
constructor(reducers = {}, initialState = {}) {
this.subscribers = [];
this.reducers = reducers;
@fabriciofmsilva
fabriciofmsilva / monorepo.md
Created April 29, 2019 18:38
Continuous integration in projects using monorepo
api = API and documentation 
chatbots = telegram, facebook and slack chatbots 
cli = codenation cli, used by developers to run the challenges 
cmd = utils and fixtures 
core = Go core packages, used by all the project 
docs = source code of internal docs (hosted at Github Pages) frontend = Vue.js project and templates used by Sam 
infra = configuration files used by staging and production servers lambda = lambda functions 
research = Python notebooks and other research assets 
sam = cli tool used by us to generate pages, include challenges and other admin tasks 
@fabriciofmsilva
fabriciofmsilva / angular-architecture.md
Last active April 30, 2019 17:04
Angular Architecture

Building an enterprise-grade Angular project structure

  • defining the entities that make up our project at each level of the stack
  • distributing our Angular and Typescript entities in folders
  • monorepos vs libraries
  • state management as a collection of service modules

Angular entities

  • modules
@fabriciofmsilva
fabriciofmsilva / events.js
Created April 23, 2019 14:11
Events with JS
const eventMethod = window.addEventListener ? 'addEventListener' : 'attachEvent'
const messageEvent = eventMethod === 'attachEvent' ? 'onmessage' : 'message'
const EVENTS = {
eventName(){}
}
window[eventMethod](messageEvent, event => {
if (event.data.serviceId === SERVICE_ID && EVENTS[event.data.name]) {
EVENTS[event.data.name](event)
@fabriciofmsilva
fabriciofmsilva / async.js
Last active January 17, 2019 16:42
JavaScript Tricks
// 1. async / await
import axios from 'axios';
async function getData() {
const result = await axios.get('https://dube.io/service/ping');
const data = result.data;
console.log('data', data);
return data;
@fabriciofmsilva
fabriciofmsilva / readme.md
Last active January 5, 2019 12:38
Serverless NodeJS
$ npm install -g serverless

$ serverless config credentials --provider aws --key xxxxxxxxxxxxxx --secret xxxxxxxxxxxxxx

$ serverless create --template aws-nodejs --path my-service

$ serverless deploy -v

$ serverless invoke -f hello -l