This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
pythonEnv = pkgs.python311.withPackages (ps: [ | |
ps.pip | |
ps.debugpy | |
ps.ipython | |
ps.numpy | |
ps.setuptools | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import unittest | |
from unittest.mock import MagicMock | |
from urllib.request import urlopen, Request | |
class EasyBrokerPropertiesResponse: | |
def easy_broker_properties_response(self): | |
api_key = os.environ["API_KEY"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@strawberry.federation.type(keys=["id"]) | |
class UserType: | |
id: strawberry.ID = strawberry.federation.field | |
@classmethod | |
def resolve_reference(cls, id: strawberry.ID): | |
return UserType(id) | |
@strawberry.federation.type(keys=["id"], description="User Type definition") | |
class ProductType: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@strawberry.federation.type(keys=["id"], extend=True) | |
class UserType: | |
id: strawberry.ID = | |
@strawberry.federation.type(keys=["id"], description="User Type definition") | |
class ProductType: | |
id: strawberry.ID | |
name: str | |
@strawberry.field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def potencial(numbers: str): | |
to_split = int(len(numbers) / 2) | |
to_sum = (int(numbers[0:to_split]) + int(numbers[to_split::])) ** 2 | |
if to_sum == int(numbers): | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### .gitlab-ci.yml | |
image: alpine | |
test: | |
script: | |
- echo "Hello Gitlab-Runner" | |
### Pull Gitlab Runner image | |
docker run -d \ | |
--name gitlab-runner \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
import logging | |
logger = logging.getLogger(__name__) | |
def quote(subtotal, vat, payment_quantity): | |
### | |
logger.INFO("Create a Quote") | |
total = subtotal + (subtotal * vat) | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
import json | |
import tempfile | |
import shutil | |
from draphene.factory import PostFactory, UserFactory | |
from django.test import override_settings | |
from graphene_django.utils.testing import GraphQLTestCase | |
MEDIA_ROOT = tempfile.mkdtemp() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl \ | |
--verbose --request OPTIONS http://localhost:8000/graphql/ \ | |
--header 'Origin: http://localhost:3000' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: POST' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation{ | |
login(username: "[email protected]" password: "admin"){ | |
access_token | |
} | |
} |
NewerOlder