<commit_before>class PostsController < ApplicationController
  before_action :set_post, only: [:show, :edit, :update, :destroy]
  before_action :authenticate_person!, except: [:index, :show]
  before_action :check_role, only: [:edit, :create, :update, :destroy, :new]

  require 'will_paginate/array'

  def index
    @posts = Post.all(order: 'created_at DESC')
    @latest_post = @posts.first
    @remaining_posts = (Post.all(order: 'created_at DESC') - [@latest_post]).paginate(page: params[:page], per_page: 20)
  end<commit_msg>use cool shift method for posts<commit_after>class PostsController < ApplicationController
  before_action :set_post, only: [:show, :edit, :update, :destroy]
  before_action :authenticate_person!, except: [:index, :show]
  before_action :check_role, only: [:edit, :create, :update, :destroy, :new]

  require 'will_paginate/array'

  def index
    @posts = Post.all(order: 'created_at DESC').paginate(page: params[:page], per_page: 20)
    @latest_post = @posts.shift
  end
{'fraction_non_alphanumeric': 0.13930348258706468, 'fraction_numerical': 0.003980099502487562, 'mean_word_length': 5.751677852348993, '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': '1062158', 'n_tokens_mistral': 347, 'n_tokens_neox': 331, 'n_words': 83}