<commit_before>require 'digest/sha1'

class NodesController < ApplicationController

  MAX_NODES_IN_LIST = 25

  def home
    @nodes = Node.find( :all, :order => 'updated_at DESC', :limit => MAX_NODES_IN_LIST )
    @node = Node.new
  end

  def show
    key = params[ :key ]
    @node = Node.find_by_key( key )
    if @node
      render :layout => false
    else
      render :text => "Can't find the key: #{ key }", :status => '404 Not Found'<commit_msg>Don't require authenticity token for node creation<commit_after>require 'digest/sha1'

class NodesController < ApplicationController
          
  protect_from_forgery :except => [ :create ]

  MAX_NODES_IN_LIST = 25

  def home
    @nodes = Node.find( :all, :order => 'updated_at DESC', :limit => MAX_NODES_IN_LIST )
    @node = Node.new
  end

  def show
    key = params[ :key ]
    @node = Node.find_by_key( key )
    if @node
      render :layout => false
    else
      render :text => "Can't find the key: #{ key }", :status => '404 Not Found'
{'fraction_non_alphanumeric': 0.11852589641434264, 'fraction_numerical': 0.01195219123505976, 'mean_word_length': 3.02, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '1193478', 'n_tokens_mistral': 351, 'n_tokens_neox': 334, 'n_words': 98}