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
(function(){ | |
var total = {}; | |
var year = '2012'; | |
var all = false; | |
function init(num) { | |
if(typeof num !== 'number') { | |
num = 0; | |
$('<div/>').css({ | |
position: 'fixed', | |
left: 0, |
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
(function(){ | |
var datePattern = new RegExp("(\\d{4})年(\\d{1,2})月(\\d{1,2})日"); | |
function formatEntry(entry) { | |
entry.date.match(datePattern); | |
var year = RegExp.$1; | |
var month = RegExp.$2; if (month.length <= 1) month = "0" + month; | |
var day = RegExp.$3; if (day.length <= 1) day = "0" + day; | |
var item = entry.item.split("\"").join("\"\""); | |
return year + month + day + ",,," + entry.price + ",\"Amazon: " + item + "\"\n"; | |
} |
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
(defmacro defworld [name bindings & body] | |
`(defn ~name ~bindings | |
(fn [~'world] | |
(println ~'world) | |
~@body))) | |
(defmacro with-world [& body] | |
`(domonad state-m | |
~@body)) |