Skip to content

Instantly share code, notes, and snippets.

View codemation's full-sized avatar

Joshua Jamison codemation

View GitHub Profile
@codemation
codemation / README.md
Created January 14, 2022 12:58 — forked from jverweijL/README.md
Adding WiFi Drivers to Ubuntu/Linux for Dell’s XPS-15 9500 with AX500

Based upon https://mukaiguy.medium.com/adding-wifi-drivers-to-ubuntu-linux-for-dells-xps-15-9500-with-ax500-f535fb42db70

Step 1 — Pre-Requisites The line of code below will update, then upgrade all of the packages and their dependencies as necessary. Then it will install git if it’s not already installed, as well as the other tools needed to build the kernels. *Note I use the -y flag to indicate that I am okay with the installs. feel free to change that if you want to be asked.

sudo apt update && sudo apt -y full-upgrade && sudo apt install -y git && sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev dwarves

I had to install a dwarf 1.17

@codemation
codemation / pydbantic_db_fixture.py
Created November 15, 2021 13:02
pydbantic_db_fixture.py
@pytest.mark.asyncio
@pytest.fixture(params=[DB_URL])
async def database_with_cache(request):
db = await Database.create(
request.param,
tables=[Employee],
cache_enabled=True,
testing=True
)
@codemation
codemation / pydbantic_db_8.py
Created November 15, 2021 12:51
pydbantic_db_8.py
from pydbantic import Database
from models import Employee
async def setup_database():
await Database.create(
'sqlite:///company.db',
tables=[Employee],
cache_enabled=True,
redis_url='redis://localhost'
)
@codemation
codemation / pydbantic_model_8.py
Created November 15, 2021 12:09
pydbantic_model_8.py
# models.py
import uuid
from datetime import datetime
from typing import Optional, Union
from pydantic import BaseModel
from pydbantic import DataBaseModel, PrimaryKey, Default
def time_now_str():
return datetime.now().isoformat()
@codemation
codemation / pydbantic_app_8.log
Created November 15, 2021 11:59
pydbantic_app_8.log
Traceback (most recent call last):
File "/home/josh/python/pydbantic/docs/medium/application/app.py", line 27, in <module>
asyncio.run(main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/josh/python/pydbantic/docs/medium/application/app.py", line 23, in main
all_employees = await Employee.all()
File "/home/josh/python/pydbantic/docs/medium/med-env/lib/python3.9/site-packages/pydbantic/core.py", line 401, in all
@codemation
codemation / pydbantic_app_8.py
Created November 15, 2021 11:58
pydbantic_app_8.py
# app.py
import asyncio
from db import setup_database
from models import Employee, Positions, Department
async def main():
# setup db
await setup_database()
@codemation
codemation / pydbantic_app_7.py
Last active November 15, 2021 11:47
pydbantic_app_7.py
# app.py
import asyncio
from db import setup_database
from models import Employee, Positions, Department
async def main():
# setup db
await setup_database()
@codemation
codemation / pydbantic_model_7.py
Created November 15, 2021 11:39
pydbantic_model_7.py
# models.py
import uuid
from datetime import datetime
from typing import Optional
from pydantic import BaseModel
from pydbantic import DataBaseModel, PrimaryKey, Default
def time_now_str():
return datetime.now().isoformat()
@codemation
codemation / pydbantic_app_6.py
Last active November 15, 2021 09:27
pydbantic_app_6.py
# app.py
import asyncio
from db import setup_database
from models import Employee, Positions
async def main():
# setup db
await setup_database()
@codemation
codemation / pydbantic_model_4.py
Last active November 15, 2021 10:19
pydbantic_model_4.py
# models.py
import uuid
from datetime import datetime
from typing import Optional
from pydbantic import DataBaseModel, PrimaryKey, Default
def time_now_str():
return datetime.now().isoformat()
def stringify_uuid():