Skip to content

Instantly share code, notes, and snippets.

View syou6162's full-sized avatar

Yasuhisa Yoshida syou6162

View GitHub Profile
@syou6162
syou6162 / aitter.js
Last active August 29, 2015 14:07 — forked from moroya/aitter.js
(function(){
var total = {};
var year = '2012';
var all = false;
function init(num) {
if(typeof num !== 'number') {
num = 0;
$('<div/>').css({
position: 'fixed',
left: 0,
(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";
}
@syou6162
syou6162 / gist:2241779
Created March 29, 2012 18:39 — forked from AlexBaranosky/gist:2233328
state monad as a way to hold 'world' state
(defmacro defworld [name bindings & body]
`(defn ~name ~bindings
(fn [~'world]
(println ~'world)
~@body)))
(defmacro with-world [& body]
`(domonad state-m
~@body))