<commit_before>var createThumb = function (post) {

  var col = document.createElement('div');
  col.setAttribute('class', 'col-md-4');

  var thumb = document.createElement('div');
  thumb.setAttribute('class', 'post-thumb');

  var link = document.createElement('a');
  link.setAttribute('href', post.url);

  var img = document.createElement('img');
  img.setAttribute('src', post.image);

  var title = document.createElement('h3');
  title.innerHTML = post.title;

  link.appendChild(img);
  link.appendChild(title);
  thumb.appendChild(link);
  col.appendChild(thumb);

  return col;

};

var createHistThumb = function (post) {

  var link = document.createElement('a');
  link.setAttribute('href', post.url);

  var row = document.createElement('div');
  row.setAttribute('class', 'row');

  var col = document.createElement('div');
  col.setAttribute('class', 'col-md-4');

  var thumb = document.createElement('div');
  thumb.setAttribute('class', 'histories-thumb');

  var img = document.createElement('img');
  img.setAttribute('src', post.image);

  var d_col = document.createElement('div');
  d_col.setAttribute('class', 'col-md-8');

  var d_thumb = document.createElement('div');
  d_thumb.setAttribute('class', 'histories-description');

  var title = document.createElement('h3');
  title.innerHTML = post.title;

  var text = document.createElement('p');
  text.innerHTML = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec laoreet, augue et dignissim consequat, nibh risus pretium mi, at congue sem enim nec lectus. Ut fringilla lacus at nibh mattis finibus.';

  d_thumb.appendChild(title);
  d_thumb.appendChild(text);
  d_col.appendChild(d_thumb);
  thumb.appendChild(img);
  col.appendChild(thumb);
  row.appendChild(col);
  row.appendChild(d_col);
  link.appendChild(row);

  return link;
}

var loadPosts = function (posts) {
  for (var i = 0; i < 3; i++) {
      var post = createThumb(posts[i]);
      $('.posts-thumb-area').append(post);
  }

  posts.forEach(function(post) {
    var post = createHistThumb(post);
    $('.histories-thumb-area').append(post);
  });
};

$(document).ready(function(){
  $.ajax({
    "type": "json",
    "method": "GET",
    "url": "http://medium-dsbr-proxy.herokuapp.com/",
    "success": loadPosts
  });
});


<commit_msg>Add snippets to histories<commit_after>var createThumb = function (post) {

  var col = document.createElement('div');
  col.setAttribute('class', 'col-md-4');

  var thumb = document.createElement('div');
  thumb.setAttribute('class', 'post-thumb');

  var link = document.createElement('a');
  link.setAttribute('href', post.url);

  var img = document.createElement('img');
  img.setAttribute('src', post.image);

  var title = document.createElement('h3');
  title.innerHTML = post.title;

  link.appendChild(img);
  link.appendChild(title);
  thumb.appendChild(link);
  col.appendChild(thumb);

  return col;

};

var createHistThumb = function (post) {

  var link = document.createElement('a');
  link.setAttribute('href', post.url);

  var row = document.createElement('div');
  row.setAttribute('class', 'row');

  var col = document.createElement('div');
  col.setAttribute('class', 'col-md-4');

  var thumb = document.createElement('div');
  thumb.setAttribute('class', 'histories-thumb');

  var img = document.createElement('img');
  img.setAttribute('src', post.image);

  var d_col = document.createElement('div');
  d_col.setAttribute('class', 'col-md-8');

  var d_thumb = document.createElement('div');
  d_thumb.setAttribute('class', 'histories-description');

  var title = document.createElement('h3');
  title.innerHTML = post.title;

  var text = document.createElement('p');
  text.innerHTML = post.snippet;

  d_thumb.appendChild(title);
  d_thumb.appendChild(text);
  d_col.appendChild(d_thumb);
  thumb.appendChild(img);
  col.appendChild(thumb);
  row.appendChild(col);
  row.appendChild(d_col);
  link.appendChild(row);

  return link;
}

var loadPosts = function (posts) {
  for (var i = 0; i < 3; i++) {
      var post = createThumb(posts[i]);
      $('.posts-thumb-area').append(post);
  }

  posts.forEach(function(post) {
    var post = createHistThumb(post);
    $('.histories-thumb-area').append(post);
  });
};

$(document).ready(function(){
  $.ajax({
    "type": "json",
    "method": "GET",
    "url": "http://medium-dsbr-proxy.herokuapp.com/",
    "success": loadPosts
  });
});



{'fraction_non_alphanumeric': 0.17503392130257803, 'fraction_numerical': 0.003165988240615106, 'mean_word_length': 4.407090464547677, 'pattern_counts': {'":': 8, '<': 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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4344405', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1405, 'n_words': 281}