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
cd ~ | |
sudo apt install git | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
exec $SHELL | |
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv |
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
### PYENV | |
export PYENV_ROOT="$HOME/.pyenv" | |
export PATH="$PYENV_ROOT/bin:$PATH" | |
export WORKON_HOME=~/.ve | |
export PROJECT_HOME=~/workspace | |
eval "$(pyenv init -)" | |
pyenv virtualenvwrapper_lazy | |
### ALIAS PYTHON DJANGO VIRTUALENV | |
alias manage='python $(cat $(echo $VIRTUAL_ENV/.project))/manage.py' |
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 math import ceil, floor | |
def round_2_down(number): | |
"""Arredonda 2 casas sempre para baixo""" | |
if number < 0: | |
return ceil(number * 100)/100 | |
return floor(number * 100)/100 | |
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
""" | |
13. wordcount | |
Este desafio é um programa que conta palavras de um arquivo qualquer de duas | |
formas diferentes. | |
A. Lista todas as palavras por ordem alfabética indicando suas ocorrências. | |
Ou seja... |
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
"""Geometry""" | |
class Point: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def __eq__(self, other): | |
return self.x == other.x and self.y == other.y |
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 itertools import zip_longest | |
class Bits(bytes): | |
CHUNK = 8 | |
def __new__(cls, n): | |
return super().__new__(cls, cls.number_to_bits(n)) | |
@staticmethod |
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 pytest | |
class IntervalMap: | |
def __init__(self): | |
self.limits = [] | |
self.map = {} | |
def __setitem__(self, upper_bound, value): | |
self.limits.append(upper_bound) |
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 pytest | |
class IntervalMap: | |
def __init__(self): | |
self.limits = [] | |
self.map = {} | |
def __setitem__(self, upper_bound, value): | |
self.limits.append(upper_bound) |
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
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2022-02-06T11:46:24Z" cacheDuration="PT604800S" entityID="http://localhost:8000/metadata/"> | |
<md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"> | |
<md:KeyDescriptor use="signing"> | |
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | |
<ds:X509Data> | |
<ds:X509Certificate>MIIGGTCCBAGgAwIBAgIUenvymK3dUpRDWbJRiCGdP+AeDHAwDQYJKoZIhvcNAQELBQAwgZsxCzAJBgNVBAYTAkJSMQswCQYDVQQIDAJTUDESMBAGA1UEBwwJc2FvIHBhdWxvMRowGAYDVQQKDBFTa3kuT25lIFNvbHV0aW9uczEQMA4GA1UECwwHU2t5Lk9uZTEWMBQGA1UEAwwNbG9jYWxob3N0LmNvbTElMCMGCSqGSIb3DQEJARYWYWRtaW5Ac2t5b25lLnNvbHV0aW9uczAeFw0yMjAxMzExNTA0MDFaFw0zMjAxMjkxNTA0MDFaMIGbMQswCQYDVQQGEwJCUjELMAkGA1UECAwCU1AxEjAQBgNVBAcMCXNhbyBwYXVsbzEaMBgGA1UECgwRU2t5Lk9uZSBTb2x1dGlvbnMxEDAOBgNVBAsMB1NreS5PbmUxFjAUBgNVBAMMDWxvY2FsaG9zdC5jb20xJTAjBgkqhkiG9w0BCQEWFmFkbWluQHNreW9uZS5zb2x1dGlvbnMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwxu7W5Z |