Skip to content

Instantly share code, notes, and snippets.

View mauricioklein's full-sized avatar

Mauricio Klein mauricioklein

View GitHub Profile
const uuidv1 = require('uuid/v1');
class OrderId {
id: string
constructor(id: string) {
this.id = id
}
static fromString(id: string): OrderId {
@mauricioklein
mauricioklein / check-ebs-snapshots.sh
Created August 11, 2019 09:11
Script to check EBS snapshots vulnerability
#!/bin/bash
#
# RUN:
# AWS_PROFILE=[profile] AWS_REGION=[region] ./check-ebs-snapshots.sh
#
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')
snapshots=$(aws ec2 describe-snapshots \
name: Daily Build
on:
# Trigger build manually
workflow_dispatch:
# Runs every day at 3pm GMT
schedule:
- cron: '0 15 * * *'
@mauricioklein
mauricioklein / README.md
Last active May 5, 2021 01:29
CDK Debugging on VSCode

Install

Place launch.json file in .vscode/ directory in the root of your CDK application

It assumes the entry point of your CDK app is in bin/app.ts.

Adjust args attribute accordingly if you use something else.

Run

@mauricioklein
mauricioklein / Admin.rb
Last active November 29, 2021 01:17
Has Many :through polymorphic problem
class Admin < ActiveRecord::Base
has_many :favorites, as: :favoritable
has_many :favorite_services, through: 'favorites', source: 'service'
end
AWSTemplateFormatVersion: 2010-09-09
Description: S3 bucket remediation automation using AWS Config and AWS Service Manager
Parameters:
Versioning:
Type: String
AllowedValues: [ "true", "false" ]
Default: "true"
@mauricioklein
mauricioklein / zssn.md
Last active April 16, 2024 14:12
Zombie Survival Social Network

ZSSN (Zombie Survival Social Network)

Descrição do Problema

O mundo finalmente atingiu o seu estado apocalíptico, onde uma pandemia causada por um virus de laboratório transforma seres humanos e animais em zumbis, seres sedentos por carne.

Você, como membro da resistência (e último sobrevivente com conhecimentos em desenvolvimento de software) foi incubido à desenvolver um sistema para compartilhamento de recursos entre os humanos não infectados.

Funcionalidades