Skip to content

Instantly share code, notes, and snippets.

@taksuyu
taksuyu / constructortest.hs
Last active August 29, 2015 14:12
pattern matching a constructor
data Test = Test | NotTest | StillNotTest deriving Show
testFuction a@Test {} = a
testFuction _ = NotTest
{-
Test -> Test
NotTest -> NotTest
StillNotTest -> NotTest
-}
@taksuyu
taksuyu / sort_backgrounds.py
Last active December 24, 2015 10:59
After setup (Python 2.7 and PIL), put it into a folder with lots of images, run and watch all the images get sorted!
#! /usr/bin/python2.7
"""
Requires:
Python Imaging Library http://www.pythonware.com/products/pil/
Version: 1.1.7 for 2.7
Information:
Python: 2.7.5
Version: 1.1.0
Author: Michael Borden <[email protected]>