Skip to content

Instantly share code, notes, and snippets.

View foxmask's full-sized avatar
🇰🇷
Focusing

FoxMaSk foxmask

🇰🇷
Focusing
View GitHub Profile
@foxmask
foxmask / models.py
Created November 17, 2024 21:42
class Model Link
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, HttpUrl, TypeAdapter, field_validator, model_validator
from sqlmodel import Field, SQLModel
from typing_extensions import Self
class LinksForm(BaseModel):
@foxmask
foxmask / maillepaille.log
Created November 17, 2024 19:57
mypy Unsupported operand types for + ("str" and "timedelta") [operator]
maillepaille.py:10: error: Incompatible types in assignment (expression has type "datetime", variable has type "str") [assignment]
maillepaille.py:15: error: Incompatible types in assignment (expression has type "date", variable has type "str") [assignment]
maillepaille.py:17: error: Incompatible types in assignment (expression has type "datetime", variable has type "str") [assignment]
maillepaille.py:19: error: Unsupported operand types for + ("str" and "timedelta") [operator]
(yeoboseyo) ✔ ~/Projects/yeoboseyo/yeoboseyo/yeoboseyo [master|✚ 6…11]
11:35 $ python app.py
여보세요 !
INFO: Started server process [25851]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
@foxmask
foxmask / client.py
Created September 2, 2021 09:38
websocket client
#!/usr/bin/env python
import asyncio
import json
import websockets
async def hello():
uri = "ws://localhost:8888"
async with websockets.connect(uri) as websocket:
@foxmask
foxmask / main.py
Created September 25, 2020 18:31
MDNavigationDrawer + ScrollView
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty, ListProperty
from kivymd.app import MDApp
from kivymd.theming import ThemableBehavior
from kivymd.uix.list import OneLineIconListItem, MDList, OneLineListItem
import sqlite3
@foxmask
foxmask / python-testing-portal-access.md
Last active November 10, 2019 17:43
Blog : Python testing portal access

Python testing portal access

Hi,

Usually when we test things we create many test_myfeature_foobar.py, test_myfeature_foobar2.py and so on to test the code and the coverage.

In my case I use pytest, and we asked me to test the access of customers portal.

So I started with

@foxmask
foxmask / gathering facts
Created June 24, 2019 12:02
ansible log info
2019-06-21 11:23:23,011 INFO tasks 14493 < TASK [Gathering Facts] >
2019-06-21 11:23:23,011 INFO tasks 14493 ------------------------
2019-06-21 11:23:23,011 INFO tasks 14493 \ ^__^
2019-06-21 11:23:23,011 INFO tasks 14493 \ (oo)\_______
2019-06-21 11:23:23,011 INFO tasks 14493 (__)\ )\/\
2019-06-21 11:23:23,011 INFO tasks 14493 ||----w |
2019-06-21 11:23:23,012 INFO tasks 14493 || ||
2019-06-21 11:23:23,012 INFO tasks 14493
@foxmask
foxmask / app.py
Created June 18, 2019 06:31
starlette app
# coding: utf-8
"""
joplin-web sauce starlette
"""
# starlette
from starlette.applications import Starlette
from starlette.config import Config
from starlette.responses import JSONResponse
from starlette.routing import Mount, Route, Router
from starlette.staticfiles import StaticFiles
@foxmask
foxmask / Dockerfile-back
Created May 23, 2019 14:07
Dockerfile-front new2
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /app/
COPY . /app
WORKDIR /app/
RUN apt-get update && apt-get install -y sqlite3
RUN pip install -r requirements.txt
@foxmask
foxmask / Dockerfile-back
Created May 23, 2019 13:13
docker-compose new1
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /app/
COPY . /app
WORKDIR /app/
RUN apt-get update && apt-get install -y sqlite3
RUN pip install -r requirements.txt