Handy Code Snippets

Manga Update Checking

Shellscript for checking the last update on a given manga from Manganato (formerly Manganelo, Mangakakalot).
wget -qO- "MANGA LINK HERE" |grep Update |perl -n -pe 's/.*<.*>(.*)<\/span><\/p>/$1/'

Point-free delta (current last)
delta = zipWith (-)
ghci> delta [73, 12, 9] [62, 9, 10]
=> [11,3,-1]

First-order differentiation approximation
dif :: Fractional a => a -> a -> a -> a
dif fxh fx h = (fxh - fx)/h
ghci> dif 3 0 1.5
=> 2.0

Elisp compose
(defun compose (x) (if (= (length x) 2) x (list (car x) (compose (cdr x)))))
(defmacro comp (x) (compose x))

Home