Skip to content

Instantly share code, notes, and snippets.

View nicholasRutherford's full-sized avatar

Niko Rutherford nicholasRutherford

View GitHub Profile
@abhin4v
abhin4v / astar.hs
Last active November 24, 2022 06:36
A* (A star) search in haskell
import qualified Data.PQueue.Prio.Min as PQ
import qualified Data.HashSet as Set
import qualified Data.HashMap.Strict as Map
import Data.Hashable (Hashable)
import Data.List (foldl')
import Data.Maybe (fromJust)
astarSearch :: (Eq a, Hashable a) => a -> (a -> Bool) -> (a -> [(a, Int)]) -> (a -> Int) -> Maybe (Int, [a])
astarSearch startNode isGoalNode nextNodeFn heuristic =
astar (PQ.singleton (heuristic startNode) (startNode, 0))
@derekphilipau
derekphilipau / delete_cloudflare_images.py
Created January 4, 2024 03:39
Delete all Cloudflare images
# Delete all Cloudflare images
# Useful if migrating to a different images provider
# Unfortunately Cloudflare still doesn't offer bulk delete
import requests
# Replace with your actual account and authorization details
account_identifier = "youraccountid"
api_token = "yourapitokenhere"