Skip to content

Instantly share code, notes, and snippets.

View Lurrobert's full-sized avatar
🔳
OPTIMISING FLOPS

Robert Lukoszko Lurrobert

🔳
OPTIMISING FLOPS
View GitHub Profile
@aeged
aeged / dijkstra.py
Last active September 11, 2022 00:28
Dijkstra's algorithm implementation using networkx (for graph dependency) and python's built-in queue library.
# dependencies for our dijkstra's implementation
from queue import PriorityQueue
from math import inf
# graph dependency
import networkx as nx
"""Dijkstra's shortest path algorithm"""
def dijkstra(graph: 'networkx.classes.graph.Graph', start: str, end: str) -> 'List':
"""Get the shortest path of nodes by going backwards through prev list
@xflr6
xflr6 / walk_gdrive.py
Last active October 11, 2025 16:03
Recursively traverse the directory tree of a Google Drive folder as variation of os.walk()
"""os.walk() variation with Google Drive API v3."""
from collections.abc import Iterator, Sequence
import os
import pathlib
from typing import TypedDict
# $ pip install google-api-python-client google-auth-oauthlib
from apiclient import discovery
from google.oauth2 import credentials
@zonble
zonble / KKSimplePlayer.swift
Created April 21, 2016 16:34
Using AudioQueue and Swift to do a simple stream player
import Foundation
import AudioToolbox
class KKSimplePlayer: NSObject {
var URL: NSURL
var URLSession: NSURLSession!
var packets = [NSData]()
var audioFileStreamID: AudioFileStreamID = nil
var outputQueue: AudioQueueRef = nil
var streamDescription: AudioStreamBasicDescription?