Skip to content

Instantly share code, notes, and snippets.

View taiwotman's full-sized avatar
🎯
Focusing

Taiwo O. Adetiloye taiwotman

🎯
Focusing
View GitHub Profile
@taiwotman
taiwotman / flasks_py2neo.py
Last active December 31, 2022 15:45
FlaskLogin Neo4j
from __future__ import absolute_import
from flask import current_app
from py2neo import Graph
import os
username = os.environ.get('NEO4J_USERNAME')
password = os.environ.get('NEO4J_PASSWORD')
class Py2Neo(object):
def __init__(self, app=None):
@taiwotman
taiwotman / docker commands
Last active October 6, 2022 01:49
gist_docker-build
## Key Docker Commands
docker build --pull --no-cache --tag=<image-name> .
docker-compose up
docker-compose down
$ docker build -t <image-name> .
docker compose up run
@taiwotman
taiwotman / Dockerfile
Created October 5, 2022 19:46
Enabling Microservices on Postgres using Docker and Docker Compose.
FROM python:latest
WORKDIR app
COPY . /app
RUN python3 -m pip install -r requirements.txt
psycopg2==2.9.3
pytest== 7.1.2
version: "3.9"
services:
postgres:
image: postgres:10.5
restart: always
environment:
- POSTGRES_USER=<username>
- POSTGRES_PASSWORD=<password>
ports:
- '5433:5432'
/****************************************************************************
* Author: Alberto Gutiérrez Jácome <agjacome@gmail.com>
* Date: 16/09/2012
*
* Compilation: javac KdTree.java
* Execution: not applicable
* Dependencies: Point2D.java RectHV.java StdDraw.java Queue.java
*
* Description: A mutable data type that uses a 2d-tree to represent a set of
* points in the unit square. A 2d-tree is a generalization of a BST to
@taiwotman
taiwotman / capacity-optimization-heuristics-approach-for-the-bus-loading-problem.ipynb
Last active January 13, 2022 14:27
Capacity Optimization Heuristic for the Bus Loading Problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@taiwotman
taiwotman / test.py
Last active March 15, 2021 15:44
Solution1
###
## Author: Taiwo O. Adetiloye
## Date: Aug 28, 2020
## Solution 1
###
''' Corner cases
1. If the prefix_length is greater that the length of the key prefix,
then the formulation would be distorted
2. The dictionary is not ideal for situation where the