Skip to content

Instantly share code, notes, and snippets.

View lfbos's full-sized avatar
🎯
Focus

Luis Felipe Boscan Nava lfbos

🎯
Focus
View GitHub Profile
@lfbos
lfbos / migrate_tasks.py
Last active May 22, 2020 15:08
Migrate celery tasks in django
# -*- encoding: utf-8 -*-
from __future__ import division
from __future__ import unicode_literals
from django.core.management.base import BaseCommand
MIGRATE_PROGRESS_FMT = """\
Migrating task {state.count}/{state.strtotal}: \
{body}\
"""
@lfbos
lfbos / script.py
Created January 22, 2018 20:11
Merge two list of dicts by key
import operator
import copy
def merge_list_of_dict(key, list_a, list_b):
result = copy.copy(list_a)
[
i.update(j) for i, j in zip(
sorted(result, key=operator.itemgetter(key)),
sorted(list_b, key=operator.itemgetter(key))
)
@lfbos
lfbos / costexplorer_test.go
Last active May 8, 2024 22:55
Go SDK AWS Cost Explorer
package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/costexplorer"
"github.com/aws/aws-sdk-go-v2/service/costexplorer/types"
)