Skip to content

Instantly share code, notes, and snippets.

View msanatan's full-sized avatar
🏠
Working from home

Marcus Sanatan msanatan

🏠
Working from home
View GitHub Profile
@msanatan
msanatan / namis_scraper.py
Last active August 29, 2015 14:04
Scraper for wholesale fish market prices in Trinidad and Tobago
from lxml import html
import requests
import time
date = time.strftime('%d-%m-%Y')
output = ''
try:
page = requests.get('http://www.namistt.com/')
except requests.exceptions.RequestException as e:
@msanatan
msanatan / Cyclic.hs
Created December 12, 2013 18:44
Simple way to check if a directed graph is cyclic in Haskell. Essentially it's a stripped down version of the Arthur B Kahn topological sorting algorithm. Uses the Functional Graph Library (http://hackage.haskell.org/package/fgl) for graph representation.
module Cyclic
(leafNode,
hasLeaf,
delLeaf,
cyclic
) where
import Data.Graph.Inductive
{- Topological sorting involves removing nodes from the graph into a list to