Skip to content

Instantly share code, notes, and snippets.

View mauricioklein's full-sized avatar

Mauricio Klein mauricioklein

View GitHub Profile
@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

name: Daily Build
on:
# Trigger build manually
workflow_dispatch:
# Runs every day at 3pm GMT
schedule:
- cron: '0 15 * * *'
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 / 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 \
const uuidv1 = require('uuid/v1');
class OrderId {
id: string
constructor(id: string) {
this.id = id
}
static fromString(id: string): OrderId {
[
{
"action": "talk",
"text": "Hello! This is an automated call from ACME company.",
"voiceName": "Brian",
"bargeIn": false
},
{
"action": "talk",
"text": "Please confirm the service request for Max Mustermann, PNR: B, C, X, 4, 5, 1, 3.",
import request from 'superagent';
export const getWeatherForCity = (city, country) => {
return new Promise((resolve, reject) => {
request
.get('http://api.openweathermap.org/data/2.5/weather')
.query({
q: `${city},${country}`,
units: 'metric',
APPID: 'ABC123'
@mauricioklein
mauricioklein / routes.js
Last active November 21, 2016 17:27
Server side rendering <noscript>
import React from 'react';
import {Route, Redirect} from 'react-router';
import {
App,
NotFound,
Panel
} from 'containers';
export default () => {
return (
@mauricioklein
mauricioklein / anagram.rb
Last active October 6, 2016 16:14
Anagram generator
#
# ANAGRAM GENERATOR
#
# Author: Mauricio Klein (mauricio [dot] klein [dot] msk [at] gmail [dot] com)
# Date: October 6th, 2016
#
#
# USAGE:
# $ ruby anagram.rb <a word>
@mauricioklein
mauricioklein / friend.rb
Created September 12, 2016 14:05
Rom Repository relation
require 'equalizer'
require 'dry/data'
module Entities
class Friend < Dry::Data::Struct
include Equalizer.new(:id, :source_id, :target_id)
attribute :id, 'int'
attribute :source_id, 'int'
attribute :target_id, 'int'