<commit_before>var getPosts = function (date) {
  var terms = {
    view: 'digest',
    after: moment(date).startOf('day').toDate(),
    before: moment(date).endOf('day').toDate()
  };
  var parameters = getParameters(terms);
  var posts = Posts.find(parameters.find, parameters.options).map(function (post, index, cursor) {
    post.rank = index;
    return post;
  });
  return posts;
}

Template[getTemplate('postsDaily')].rendered = function  () {
  console.log('rendered')
}
Template[getTemplate('postsDaily')].helpers({
  postsLoaded: function () {
    return !!Session.get('postsLoaded');
  },
  post_item: function () {
    return getTemplate('post_item');
  },
  days: function () {
    var daysArray = [];
    // var days = this.days;
    var days = Session.get('postsDays');
    for (i = 0; i < days; i++) {
      daysArray.push({
        date: moment().subtract('days', i).startOf('day').toDate()
      });
    }
    return daysArray;
  },
  posts: function () {
    return getPosts(this.date);
  },
  loadMoreUrl: function () {
    var count = parseInt(Session.get('postsDays')) + 3;
    return '/daily/' + count;
  }
});

// Template[getTemplate('postsDaily')].events({
//   'click .more-button': function (e) {
//     e.preventDefault();
//     var count = parseInt(Session.get('postsDays')) + 3;
//     Session.set('postsDays', count);
//   } 
// });<commit_msg>cleanup<commit_after>var getPosts = function (date) {
  var terms = {
    view: 'digest',
    after: moment(date).startOf('day').toDate(),
    before: moment(date).endOf('day').toDate()
  };
  var parameters = getParameters(terms);
  var posts = Posts.find(parameters.find, parameters.options).map(function (post, index, cursor) {
    post.rank = index;
    return post;
  });
  return posts;
}

Template[getTemplate('postsDaily')].helpers({
  postsLoaded: function () {
    return !!Session.get('postsLoaded');
  },
  post_item: function () {
    return getTemplate('post_item');
  },
  days: function () {
    var daysArray = [];
    // var days = this.days;
    var days = Session.get('postsDays');
    for (i = 0; i < days; i++) {
      daysArray.push({
        date: moment().subtract('days', i).startOf('day').toDate()
      });
    }
    return daysArray;
  },
  posts: function () {
    return getPosts(this.date);
  },
  loadMoreUrl: function () {
    var count = parseInt(Session.get('postsDays')) + 3;
    return '/daily/' + count;
  }
});
{'fraction_non_alphanumeric': 0.1857495881383855, 'fraction_numerical': 0.002059308072487644, 'mean_word_length': 3.2097053726169844, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1562549', 'n_tokens_mistral': 804, 'n_tokens_neox': 780, 'n_words': 159}