<commit_before>String.prototype.ellipis = function(len) {
  len = len || 60;
  if (this.length > len) return this.substr(0, len - 3) + "...";
  return this;
};

$(function() {
  var pendingTransfers = 0;
    var resourceTemplate = $('#templates .resource').compile({
      '@href': 'url',
      '.name': 'name',
      '.size': 'size',
      '.date': 'date'
    });
  
  var loadResources = function() {
    $.getJSON("/resources.js", function(data) {
      var resources = $("#resources");
      
      for (var i = 0; i < data.length; i++) {
        // data[i].file_content_type

        var d = new Date(data[i].updated_at);

        var resource = $(resourceTemplate({
          url: data[i].path,
          name: data[i].name.ellipis(30),
          size: Math.floor(data[i].size / 1024) + " kb",
          date: d.toDateString()
      }));
        
        resources.append(resource);
      }
      
      console.log(data.length);<commit_msg>Cleaned up javascript<commit_after>String.prototype.ellipis = function(len) {
  len = len || 60;
  if (this.length > len) return this.substr(0, len - 3) + "...";
  return this;
};

$(function() {
  var pendingTransfers = 0;
    var resourceTemplate = $('#templates .resource').compile({
      '@href': 'url',
      '.name': 'name',
      '.size': 'size',
      '.date': 'date'
    });
  
  var loadResources = function() {
    $.getJSON("/resources.js", function(data) {
      var resources = $("#resources");
      
      for (var i = 0; i < data.length; i++) {
        var d = new Date(data[i].updated_at);

        var resource = $(resourceTemplate({
          url: data[i].path,
          name: data[i].name.ellipis(30),
          size: Math.floor(data[i].size / 1024) + " kb",
          date: d.toDateString()
        }));
        
        resources.append(resource);
      }
{'fraction_non_alphanumeric': 0.1839080459770115, 'fraction_numerical': 0.013136288998357963, 'mean_word_length': 2.179130434782609, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '908205', 'n_tokens_mistral': 605, 'n_tokens_neox': 581, 'n_words': 129}