<commit_before>class DiscoverController < ApplicationController

  def staff_picks
    @week = Date.today
    staff_picks = Product.where(slug: (ENV['STAFF_PICKS'] || '').split(','))
    @products = (staff_picks + Showcase.this_weeks_products).take(10)
  end

  def trending
    @products = Product.public_products
                       .where('votes_count >= ?', 10)
                       .order(updated_at: :desc)
                       .order(votes_count: :desc)
                       .limit(10)
  end

  def most_wanted
    @products = Product.public_products
                       .where('votes_count >= ?', 5)
                       .order(votes_count: :desc)
                       .page(params[:page])
  end

  def no_commits
    @products = Product.public_products
                       .repos_gt(0)
                       .where(commit_count: 0)
                       .order(votes_count: :desc)
                       .page(params[:page])
  end

  def tech
    @tech = Search::TechFilter.find(params[:tech])
    if signed_in?
      @saved_search = current_user.saved_searches.find_by(query: "tag:#{params[:tech]}")
    end
    @products = Product.public_products
                       .where('votes_count >= ?', 5)
                       .tagged_with_any(@tech.tags)
                       .order(votes_count: :desc)
                       .page(params[:page])

    @needing_commit = Product.public_products
                       .repos_gt(0)
                       .where('votes_count >= ?', 3)
                       .where(commit_count: 0)
                       .order("Random()")
                       .limit(2)
  end

end
<commit_msg>show unique staff picks on discover page<commit_after>class DiscoverController < ApplicationController

  def staff_picks
    @week = Date.today
    staff_picks = Product.where(slug: (ENV['STAFF_PICKS'] || '').split(','))
    @products = (staff_picks + Showcase.this_weeks_products).uniq.take(10)
  end

  def trending
    @products = Product.public_products
                       .where('votes_count >= ?', 10)
                       .order(updated_at: :desc)
                       .order(votes_count: :desc)
                       .limit(10)
  end

  def most_wanted
    @products = Product.public_products
                       .where('votes_count >= ?', 5)
                       .order(votes_count: :desc)
                       .page(params[:page])
  end

  def no_commits
    @products = Product.public_products
                       .repos_gt(0)
                       .where(commit_count: 0)
                       .order(votes_count: :desc)
                       .page(params[:page])
  end

  def tech
    @tech = Search::TechFilter.find(params[:tech])
    if signed_in?
      @saved_search = current_user.saved_searches.find_by(query: "tag:#{params[:tech]}")
    end
    @products = Product.public_products
                       .where('votes_count >= ?', 5)
                       .tagged_with_any(@tech.tags)
                       .order(votes_count: :desc)
                       .page(params[:page])

    @needing_commit = Product.public_products
                       .repos_gt(0)
                       .where('votes_count >= ?', 3)
                       .where(commit_count: 0)
                       .order("Random()")
                       .limit(2)
  end

end

{'fraction_non_alphanumeric': 0.11373134328358209, 'fraction_numerical': 0.00835820895522388, 'mean_word_length': 1.4895988112927192, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4724130', 'n_tokens_mistral': 1012, 'n_tokens_neox': 925, 'n_words': 160}