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 pyautogui | |
comment = Point(x=205, y=587) | |
textarea = Point(x=239, y=261) | |
pyautogui.typewrite("asdf") | |
button = Point(x=449, y=325) | |
def click(x, y): | |
pyautogui.moveTo(x, y) | |
pyautogui.click() |
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
@Serializable | |
class Endereco( | |
val planeta: String, | |
val galaxia: String, | |
) | |
@Serializable | |
class Aluno( | |
val nome: String, | |
val media: Float, |
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
struct aluno { | |
char nome[50]; | |
float media; | |
}; |
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 kotlinx.serialization.* | |
import kotlinx.serialization.json.* | |
@Serializable | |
class Endereco( | |
val planeta: String, | |
val galaxia: String, | |
) | |
@Serializable |
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
// ... | |
fun main() { | |
val aluno = Json.decodeFromString<Aluno>("""{ | |
"nome":"Luke Skywalker", | |
"media":9.8, | |
"endereco":{"planeta":"Tatooine","galaxia":"Outer Rim"} | |
}""") | |
println(aluno.nome) | |
println(aluno.media) |
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
@ECHO OFF | |
set git_file=%1 | |
set out=%2 | |
curl %git_file% > %out% | |
gh gist create %out% | |
del %out% |
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 pydantic import BaseModel | |
from typing import Optional | |
from datetime import datetime | |
class Location(BaseModel): | |
id: Optional[int] | |
device_id: int | |
lat: float | |
long: float |
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 app.domain import model as domain_model | |
from app.adapter.rest import model as rest_model | |
def to_domain_model(location: rest_model.Location) -> domain_model.Location: | |
domain_location = domain_model.Location(**vars(location)) | |
return domain_location | |
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 typing | |
import fastapi | |
from app.adapter.db import location_repository_impl | |
from app.domain.use_cases.location import list_location_use_case | |
from app.domain.use_cases.location import create_location_use_case | |
from app.adapter.rest import model | |
from app.adapter.rest import mapper |
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 sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_alchemy.db" | |
engine = create_engine(SQLALCHEMY_DATABASE_URL) | |
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) | |
Base = declarative_base() |
OlderNewer