Skip to content

Instantly share code, notes, and snippets.

View jprivillaso's full-sized avatar
🌏
Writing scalable bits

Juan Rivillas jprivillaso

🌏
Writing scalable bits
  • Belo Horizonte, Brazil
View GitHub Profile
import Logger from 'bunyan';
import PrettyStream from 'bunyan-pretty-colors';
const logStream = new PrettyStream();
logStream.pipe(process.stdout);
const log = Logger.createLogger({
name: 'message-consumer',
streams: [{
level: 'info',
@jprivillaso
jprivillaso / eslint.js
Last active August 11, 2021 17:08
My default configuration for ESLINT
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb',
'plugin:import/typescript'
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
@jprivillaso
jprivillaso / Dockerfile
Created August 11, 2021 17:04
Node/TS API Dockerfile
FROM node:14-alpine
# update packages
RUN apk update
# create root application folder
WORKDIR /app
# copy configs to /app folder
COPY package*.json ./
@jprivillaso
jprivillaso / database.env
Created August 11, 2021 17:02
Docker compose to setup database
POSTGRES_USER=unicorn_user
POSTGRES_PASSWORD=magical_password
POSTGRES_DB=modern_api
@jprivillaso
jprivillaso / Thread.json
Created June 11, 2020 23:57
Extension of Official Thread.json sample data from AWS Documentation
{
"Thread": [
{
"PutRequest": {
"Item": {
"ForumName": {
"S": "Amazon DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 1"
@jprivillaso
jprivillaso / weakmap.js
Last active May 16, 2020 21:46
WeakMap Usage
const getSomeUserFromAPI = async () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve({
id: 1,
name: 'Juan',
state: 'ACTIVE'
});
}, 100);
});
@jprivillaso
jprivillaso / SoftwareEngineer.md
Created May 13, 2020 13:01
Software Engineer role at Energicos Gmbh

SOFTWARE ENGINEER ENERGICOS GMBH

Energicos is a utility company headquartered in Berlin/ Germany. We supply Gas, Electricity and Heat to mainly residential customers in Germany. Energicos energy supply is based on real-time data analysis to minimise the carbon footprint. The software representing the backbone of our real-time data analysis is being developed by a 100% distributed team using cutting-edge technologies. Our Applications are using AWS Serverless as main architecture layer. We use multiple AWS services supporting scalability for both the team and the resulting features to ensure a rapid feature development and deploy process. To accommodate our growing business we are looking for an independent and experienced engineer with great analytical skills and advanced knowledge regarding AWS services.

Main Responsibilities for this position:

  • Build new APIs using swagger and VTL integrations with DynamoDB
AWSTemplateFormatVersion: 2010-09-09
Description: >
This template creates a lambda function that verifies an email under the current
aws account using Route53 DNS TXT records
Last Modified: 05 February 2019
Author: Juan Rivillas <jprivillaso@gmail.com>
Metadata: {}
Parameters: {}
const generateWebpackStats = (info, webpackProcessName) => {
const fs = require('fs');
const dir = path.resolve(__dirname, '../../stats');
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
const fileName = `../../stats/${webpackProcessName}-stats.json`;
const compile = (configObject, webpackProcessName) => {
return new Promise((fulfill, reject) => {
webpack(configObject, (err, stats) => {
if (err) {
console.error(err.stack || err);
if (err.details) {
console.error(err.details);