This file contains hidden or 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 typing import Sequence, Union, List | |
from dataclasses import dataclass, field | |
import random | |
@dataclass | |
class Card: | |
color: str | |
value: Union[int, str] | |
AVAILABLE_COLORS: Sequence[str] = field(default=('coeur', 'pique', 'trèfle', 'carreau'), repr=False) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 typing import Optional | |
class SquareDrawer: | |
def __init__(self, side_size: int = 5, side_amount: int = 4) -> None: | |
self._check_params(side_size, side_amount) | |
def draw_square( | |
self, side_size: Optional[int] = None, side_amount: Optional[int] = None | |
) -> None: | |
self._check_params(side_size, side_amount) | |
self._print_square_row() |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from abc import ABC, abstractmethod | |
from dataclasses import dataclass | |
class Writer(ABC): | |
@abstractmethod | |
def write(self, text: str) -> None: | |
pass |
This file contains hidden or 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 lxml import etree | |
xml = etree.parse('FA173049.xml') | |
for entity in xml.docinfo.internalDTD.entities(): | |
print(f'{entity.name}.{entity.content}') |
This file contains hidden or 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
bonjour | |
réinitialiser les paramètres de connexion | |
clic droit sur le menu démarrer | |
invite d commande (admin) | |
dans l'invite de commande tu écris ( puis entrée à chaque fois et ne pas oublier les espaces ) | |
netsh winsock reset | |
netsh winhttp reset proxy | |
netsh winhttp reset tracing | |
netsh winsock reset catalog |
This file contains hidden or 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
<script> | |
class NavBarCustomizer { | |
constructor() { | |
this.navbar = document.querySelector('#mainNav'); | |
this.gray = '#212529'; | |
this.white = '#ffffff'; | |
} | |
custom() { | |
if (! document.querySelector('.masthead')) { | |
if (this.navbar.classList.contains('navbar-scrolled')) { |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from typing import Callable | |
class Converter: | |
def __init__(self, lang: str = 'en') -> None: | |
self.lang: str = lang | |
if self.lang == 'fr': | |
self.part: str = 'vers' | |
elif self.lang == 'en': |
This file contains hidden or 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
document.querySelector('form.save').addEventListener('submit', () => { | |
let data = FormData(); | |
data.append('substitute', this.querySelector('input[name=substitute]')); | |
data.append('substituted', this.querySelector('input[name=substituted]')); | |
let xhr = new XmlHttpRequest(); | |
xhr.open('POST', '{% url "favorite:save" %}'); | |
xhr.addEventListener('load', () => { | |
const answer = JSON.parse(xhr.responseText); | |
if (xhr.status == 200) { | |
let status = answer.status; |
This file contains hidden or 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
[[source]] | |
name = "pypi" | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
[dev-packages] | |
mypy = "*" | |
flake8 = "*" | |
ipython = "*" | |
django-stubs = "*" |