This file contains hidden or 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
#!/usr/bin/env osascript -l JavaScript | |
var numDaysToKeep = 20; | |
var now = $.NSDate.date; | |
console.log("Now:", now.description.js); | |
var deleteThreshold = now.dateByAddingTimeInterval(-86400 * numDaysToKeep); | |
console.log("Will delete items whose date added is earlier than", deleteThreshold.description.js); | |
var urlPath = $.NSURL.alloc.initFileURLWithPathIsDirectory($('~/.Trash').stringByExpandingTildeInPath, true); | |
var fm = $.NSFileManager.defaultManager; | |
var urlContents = fm.contentsOfDirectoryAtURLIncludingPropertiesForKeysOptionsError(urlPath, ["NSURLAddedToDirectoryDateKey"], $.NSDirectoryEnumerationSkipsHiddenFiles, null).js; |
This file contains hidden or 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
{-# LANGUAGE RecordWildCards #-} | |
module RNCryptor (Credentials(..), encrypt, decrypt) where | |
import Control.Applicative ((<$>), (<*>), pure) | |
import Control.Monad | |
import Control.Monad.Trans (liftIO) | |
import Control.Error (hoistEither, note, hush, runEitherT, EitherT) | |
import qualified Data.ByteString as B | |
import qualified Data.Attoparsec.ByteString as PB |
NewerOlder