This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# btrfs-undelete | |
# Copyright (C) 2013 Jörg Walter <[email protected]> | |
# This program is free software; you can redistribute it and/or modify it under | |
# the term of the GNU General Public License as published by the Free Software | |
# Foundation; either version 2 of the License, or any later version. | |
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then | |
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2 | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Time.Clock | |
import Data.Time.Calendar | |
currentDate :: IO (Integer, Int, Int) | |
currentDate = fmap (toGregorian . utctDay) getCurrentTime | |
daysOfMonth :: Integer -> Int -> [Day] | |
daysOfMonth year month = map (fromGregorian year month) [1..gregorianMonthLength year month] | |
main = do |