- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
- Ultimate Code Generator - https://webcode.tools/
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 safe import safe | |
| def get(default=None): | |
| '''Return a function f(struct, key) to obtain the value | |
| struct[key] or default if key is out of range. | |
| ''' | |
| return safe(default)(lambda struct, key: struct[key]) |
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
| # What if there was an option | |
| # to disable the ability for lists | |
| # to respond to index -1? | |
| from collections import UserList | |
| class StrictList(UserList): | |
| '''List that does not allow index < 0''' | |
| def __getitem__(self, index): |
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 .social_media_post import SocialMediaPost | |
| from .social_media_post_publisher import SocialMediaPostPublisher | |
| # This is used by 'from socsocial_media_post import *' | |
| # As far as there is nothing else here and in app.py | |
| # we import the classes explicitely, this part can be ommited | |
| __all__ = [ | |
| 'SocialMediaPost', | |
| 'SocialMediaPostPublisher' | |
| ] |
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
| ''' | |
| https://twitter.com/jangiacomelli/status/1343676834085543936 | |
| ''' | |
| from datetime import datetime, timedelta | |
| import logging | |
| class User: | |
| def __init__(self, username): |
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
| # New Stack Implementation | |
| import logging | |
| class Stack: | |
| def __init__(self): | |
| self._items = [] | |
| def push(self, item): | |
| self._items.append(item) |
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 the @NumFOCUS telethon | |
| title: Z for zip | |
| author: @dontusethiscode | |
| date: December 19, 2020 | |
| python version: >= 3.8 | |
| video: https://youtu.be/gzbmLeaM8gs?t=15648 | |
| edited by: @vitalizzare | |
| date: January 10, 2021 |
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
| var_space = np.dtype([ | |
| ('name', 'S5'), # 5 bytes for the name | |
| ('age', 'i1'), # 1 byte for the age | |
| ('weight', 'f4') # 4 bytes for the weight value | |
| ]) # 10 bytes in total to describe 1 person | |
| def init_persons(n:int) -> np.ndarray: | |
| '''Get initial values for n persons. | |
| Return numpy.ndarray of dtype var_space''' |
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
| # https://replit.com/@winetoxin/Winetoxins-Simple-Calculator | |
| from operator import add, sub, mul, truediv | |
| operations = {"+": add, "-": sub, "*": mul, "/": truediv} | |
| intro = "Welcome to the Winetoxin's Python Project!!!" | |
| decoration = '-+-' | |
| border = decoration * (len(intro)//len(decoration)) + decoration[:len(intro)%len(decoration)] |
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
| logo = """ | |
| ____ _ _ _ _ | |
| / ___|_ _ ___ ___ ___ __ _ | \ | |_ _ _ __ ___ | |__ ___ _ __| | | |
| | | _| | | |/ _ \/ __/ __| / _` | | \| | | | | '_ ` _ \| '_ \ / _ \ '__| | | |
| | |_| | |_| | __/\__ \__ \ | (_| | | |\ | |_| | | | | | | |_) | __/ | |_| | |
| \____|\__,_|\___||___/___/ \__,_| |_| \_|\__,_|_| |_| |_|_.__/ \___|_| (_) | |
| """ |
OlderNewer