Skip to content

Instantly share code, notes, and snippets.

View juancresc's full-sized avatar

Juan Manuel Crescente juancresc

  • Argentina
View GitHub Profile
@juancresc
juancresc / buckets.py
Last active June 29, 2022 14:25
Get buckets size, cost and location
import boto3
import datetime
from hurry.filesize import size
from botocore.exceptions import ClientError
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
location_search = 'us-west-2'
#location_search = 'us-east-1'
s3_client = boto3.client('s3')
@juancresc
juancresc / 8queen-solver
Last active February 12, 2019 01:14
A solution to 8 queen problem in python3
import itertools
def valid(solution):
col_1 = 0
for row_1 in solution:
row_1 = int(row_1)
col_2 = 0
for row_2 in solution:
row_2 = int(row_2)
if col_1 != col_2: # do not compare to itself
if col_1 == col_2: # same column? not gonna happend, but I want to leave it here as a guide