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 sqlalchemy import create_engine, Column, Integer, String, select | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy.ext.declarative import declarative_base | |
| # Create database schema | |
| Base = declarative_base() | |
| class Task(Base): | |
| __tablename__ = "task" | |
| task_id = Column(Integer, primary_key=True) | |
| title = Column(String) |
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
| import asyncio | |
| import time | |
| async def me_first(): | |
| await asyncio.sleep(1) | |
| return "I'm first!" | |
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
| import asyncio | |
| import time | |
| async def me_first(): | |
| await asyncio.sleep(1) | |
| return "I'm first!" | |
| async def me_second(): | |
| await asyncio.sleep(1) |
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
| import asyncio | |
| async def something_async(): | |
| # Wait 3 seconds | |
| await asyncio.sleep(3) | |
| return "Now we're cooking with fire!" | |
| async def main(): | |
| result = await something_async() |
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
| import asyncio | |
| async def something_async(): | |
| # Wait 3 seconds | |
| await asyncio.sleep(3) | |
| return "I'm async (sortof) now!" | |
| def main(): | |
| result = something_async() |
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 pprint import pprint | |
| async def something_async(): | |
| return "I'm not really async!" | |
| def main(): | |
| coroutine = something_async() | |
| print(f"{coroutine}\n") | |
| pprint(dir(coroutine)) |
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
| { | |
| "name": "Debug Jest Tests", | |
| "type": "node", | |
| "request": "launch", | |
| "runtimeArgs": [ | |
| "--inspect-brk", | |
| "${workspaceRoot}/node_modules/.bin/jest", | |
| "--runInBand", | |
| "--coverage", | |
| "false" |
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
| { | |
| "watch": ["src"], | |
| "ext": "ts", | |
| "ignore": ["src/**/*.spec.ts"], | |
| "exec": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register src/main.ts " | |
| } |
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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Debug Nest Framework", | |
| "args": [ | |
| "${workspaceFolder}/src/main.ts" | |
| ], |
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
| { | |
| "collection": "@nestjs/schematics", | |
| "sourceRoot": "src", | |
| "compilerOptions": { | |
| "plugins": ["@nestjs/swagger/plugin"] | |
| } | |
| } |