Skip to content

Instantly share code, notes, and snippets.

View stephensanwo's full-sized avatar

Stephen Sanwo stephensanwo

View GitHub Profile
@stephensanwo
stephensanwo / makefile
Last active December 9, 2022 14:29
postgres-docker-setup-makefile
postgres:
docker run --name <postgres-container-name> -p 5432:5432 -e POSTGRES_PASSWORD=<postgres-password> -d postgres:14-alpine
createdb:
docker exec -it <postgres-container-name> createdb --username=<username> --owner=postgres <db-name>
dropdb:
docker exec -it <postgres-container-name> dropdb <db-name>
migrateup:
@stephensanwo
stephensanwo / pair_finding_in_list.py
Last active April 7, 2021 23:50
Algorithms and Data Structures
# find the pairs of numbers in list ar of length n, and return the number of pairs in the list
n = 9
ar = [10, 20, 20, 10, 10, 30, 50, 10, 20]
def sockMerchant(n, ar):
i = 0
data = sorted(ar)
pair = 0
while i < len(data)-1:
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@stephensanwo
stephensanwo / Python Cheatsheet.md
Last active May 25, 2022 15:51
Python Comprehensive Cheatsheet