Skip to content

Instantly share code, notes, and snippets.

View igorlg's full-sized avatar

Igor Gentil igorlg

View GitHub Profile

Keybase proof

I hereby claim:

  • I am igorlg on github.
  • I am igorlg (https://keybase.io/igorlg) on keybase.
  • I have a public key ASDKo31X3pr6syAi9zz3oFyns-h0nk9evecYBjpm_dtaWwo

To claim this, I am signing this object:

@igorlg
igorlg / README.md
Created September 30, 2016 00:26
Simple Python Code Challenge

QUESTION

Write a function that, given an input array of integers and a desired target_sum, returns the number of combinations, of any length, that add up to that target_sum.

@igorlg
igorlg / parse_budget.py
Created May 11, 2016 02:53
YNAB Export Parser - Parse CSV Files exported from YNAB and add extra fields
import csv, sys
from datetime import date,datetime
def parse_budget(csvarr):
if '$' not in csvarr[4]:
return False
dt = datetime.strptime(csvarr[0], '%b %Y')
month = dt.month
year = dt.year
@igorlg
igorlg / ecs-autoscaing.json
Created June 12, 2015 21:54
AWS CloudFormation template for ECS AutoScaling Group
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Template for a VPC with High Availability NAT for ECS",
"Parameters": {
"ClusterName": {
"Description": "The ECS Cluster Name",
"Type": "String"
},
"InstanceType": {
"Description": "NAT instance type",
@igorlg
igorlg / vpc-nat-ha.json
Last active April 20, 2017 18:58
AWS CloudFormation VPC Templates
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Template for a VPC with High Availability NAT for ECS",
"Parameters": {
"NATInstanceType": {
"Description": "NAT instance type",
"Type": "String",
"Default": "t2.micro",
"AllowedValues": [
"t2.micro",
@igorlg
igorlg / aws_tags.rb
Last active June 6, 2016 08:16
Facter for AWS EC2 Instance Tags
require 'open-uri'
require 'aws-sdk-core'
def aws_metadata(path)
return open("http://169.254.169.254/latest/meta-data/#{path}").read.split("\n")[0]
end
Aws.config[:region] = aws_metadata('placement/availability-zone')[0..-2]
Aws.config[:credentials] = Aws::InstanceProfileCredentials.new
ec2 = Aws::EC2::Client.new