<commit_before>
/*
 * GET home page.
 */

var _u = require('underscore');
var data = require('../data');

exports.index = function(req, res) {
  var tools = data.tools, tags = [];

  if (req.params[0] && req.params[0].length > 0) {
    tags = req.params[0].split("+");

    var selCategories = _u.intersection(tags, _u.keys(data.categories));
    var selPlatforms = _u.intersection(tags, _u.keys(data.platforms));
    var selLicenses = _u.intersection(tags, _u.keys(data.licenses));

    tools = _u.filter(tools, function(tool) {
      return (selCategories.length == 0 || _u.intersection(selCategories, tool.tags).length > 0) &&
             (selPlatforms.length == 0 || _u.intersection(selPlatforms, tool.tags).length > 0) &&
             (selLicenses.length == 0 || _u.intersection(selLicenses, tool.tags).length > 0);
    });
  } else {
    tools = tools.slice(tools.length > 20 ? tools.length-20 : 0);
  }

  res.render('index', {
    title: 'Devops Bookmarks',
    tools: tools,
    tags: tags,
    platforms: data.platforms,
    categories: data.categories,
    licenses: data.licenses,
    _u: _u
  });
};<commit_msg>Show all tools temporarily<commit_after>
/*
 * GET home page.
 */

var _u = require('underscore');
var data = require('../data');

exports.index = function(req, res) {
  var tools = data.tools, tags = [];

  if (req.params[0] && req.params[0].length > 0) {
    tags = req.params[0].split("+");

    var selCategories = _u.intersection(tags, _u.keys(data.categories));
    var selPlatforms = _u.intersection(tags, _u.keys(data.platforms));
    var selLicenses = _u.intersection(tags, _u.keys(data.licenses));

    tools = _u.filter(tools, function(tool) {
      return (selCategories.length == 0 || _u.intersection(selCategories, tool.tags).length > 0) &&
             (selPlatforms.length == 0 || _u.intersection(selPlatforms, tool.tags).length > 0) &&
             (selLicenses.length == 0 || _u.intersection(selLicenses, tool.tags).length > 0);
    });
  } else {
    // show all tools
    //tools = tools.slice(tools.length > 20 ? tools.length-20 : 0);
  }

  res.render('index', {
    title: 'Devops Bookmarks',
    tools: tools,
    tags: tags,
    platforms: data.platforms,
    categories: data.categories,
    licenses: data.licenses,
    _u: _u
  });
};
{'fraction_non_alphanumeric': 0.16878006121556624, 'fraction_numerical': 0.013117621337997376, 'mean_word_length': 3.16, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2589936', 'n_tokens_mistral': 807, 'n_tokens_neox': 764, 'n_words': 158}