Skip to content

Instantly share code, notes, and snippets.

View guilatrova's full-sized avatar
🐍
Making Python learning easy

Guilherme Latrova guilatrova

🐍
Making Python learning easy
View GitHub Profile
@guilatrova
guilatrova / example.html
Created March 24, 2022 10:13
Highlightjs with copy badge
<!-- Coding styles -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/highlight.min.js" integrity="sha512-z+/WWfyD5tccCukM4VvONpEtLmbAm5LDu7eKiyMQJ9m7OfPEDL7gENyDRL3Yfe8XAuGsS2fS4xSMnl6d30kqGQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- For the highlight badge -->
<script src="https://unpkg.com/highlightjs-badge/highlightjs/highlight.pack.js"></script>
<script src="https://unpkg.com/highlightjs-badge/highlightjs-badge.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
document.addEventListener("DOMContentLoaded", (event) => {
@guilatrova
guilatrova / containers.tf
Last active February 15, 2022 17:11
Terraform ECS recipe sample
locals {
ecr_name = "ecrname"
ecs_cluster_name = "clustername"
application_name = "appname"
}
resource "aws_ecr_repository" "ecr" {
name = local.ecr_name
image_tag_mutability = "MUTABLE"
@guilatrova
guilatrova / .pre-commit-config.yaml
Last active December 6, 2021 15:06
Base Python Config: pre-commit hooks and pyproject.toml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.11b1
hooks:
- id: black

Keybase proof

I hereby claim:

  • I am guilatrova on github.
  • I am latrova (https://keybase.io/latrova) on keybase.
  • I have a public key whose fingerprint is 73B4 2719 C3A1 3957 B0BC 688D 3EB9 DFEB EA17 FB67

To claim this, I am signing this object:

@guilatrova
guilatrova / .gitignore
Created December 10, 2017 12:44
Latrova Commits Deploy /dist to Heroku with buildpack
...
node_modules
#dist folder
#dist <- Commented, you can remove this line if you will
# IDEA/Webstorm project files
.idea
*.iml
...
@guilatrova
guilatrova / Procfile
Last active December 10, 2017 12:31
Latrova Commits Deploy /dist to Heroku with Express
web: node server.js
@guilatrova
guilatrova / tests.py
Last active October 21, 2017 11:36
Latrova Commits DRF Tests 1.4
def test_list_url_only_allows_get_and_post(self):
resolver = self.resolve_by_name('transactions')
self.assert_has_actions(['get', 'post'], resolver.func.actions)
def test_single_url_allows_all_methods_except_post(self):
"""All methods are: GET, PUT, PATCH and DELETE"""
resolver = self.resolve_by_name('transaction', pk=1)
self.assert_has_actions(['get', 'put', 'patch', 'delete'], resolver.func.actions)
@guilatrova
guilatrova / tests.py
Created October 21, 2017 11:22
Latrova Commits DRF Tests 1.3
from django.test import TestCase
from django.urls import reverse, resolve
from transactions.views import TransactionViewSet
class TransactionsUrlsTestCase(TestCase):
def test_resolves_list_url(self):
resolver = self.resolve_by_name('transactions')
@guilatrova
guilatrova / drf_tests_urls.py
Last active October 21, 2017 11:59
Latrova Commits DRF Tests 1.2
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^transactions/', include('transactions.urls'))
]
@guilatrova
guilatrova / models.py
Last active October 21, 2017 11:04
LatrovaCommits DRF Tests 1.1
from django.db import models
from django.contrib.auth.models import User
class Transaction(models.Model):
description = models.CharField(max_length=100)
value = models.DecimalField(max_digits=5, decimal_places=2)
user = models.ForeignKey(User)