Skip to content

Instantly share code, notes, and snippets.

@rolios
rolios / IJ-template-verbose-log
Created July 7, 2014 16:23
IntelliJ live template to create verbose logs with timber
groovyScript("def result='Logger.tag(TAG).v(\"'+_1+' ['; _2.each { result+=it+'=%s, '}; if(_2.size() > 0) { result = result.substring(0, result.length()-2); }; result+=']\"'; _2.each { result+=', '+ it}; result+=');'; return result;", methodName(), methodParameters())
import Data.Time.Clock
import Data.Time.Calendar
import Data.Time.Format
import System.Locale
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]