Skip to content

Instantly share code, notes, and snippets.

View terrorgarten's full-sized avatar
♠️
WIP

Matěj Konopík terrorgarten

♠️
WIP
  • ZONER
  • CZ
  • 22:11 (UTC -12:00)
View GitHub Profile
# Copyright (c) Matěj Konopík, FIT BUT, 2023.
from py2neo import Graph, Relationship, Node
from time import time
from enum import Enum
import zipfile
import tempfile
import os
import shutil
import csv
@terrorgarten
terrorgarten / gn_driver.py
Created October 29, 2023 00:33
GTFS -> NEO4J import script, which automatically builds the graph from the input ZIP file passed during construction of GNDriver object. Expect longer runtime for big datasets.
# Copyright (c) Matěj Konopík, FIT BUT, 2023.
from py2neo import Graph, Relationship, Node
from time import time
from enum import Enum
import zipfile
import tempfile
import os
import shutil
import csv
@terrorgarten
terrorgarten / bresenham.py
Last active August 16, 2023 14:45
Bresenham (midpoint) algorithm using pygame
import pygame
# Initialize pygame
pygame.init()
# Window dimensions and grid size
window_size = (800, 800)
grid_size = 40
num_rows = window_size[1] // grid_size
num_cols = window_size[0] // grid_size