<commit_before>require 'sinatra'
require 'securerandom'
require 'haml'
require './lib/sinatra/redis/redis.rb'

enable :static
set :redis, 'redis://localhost:6379/0'

@title = 'Anonypaste: Get pasted.'
	
get '/' do
	haml :index
end

get '/:paste_id' do |paste_id|
		@ttl = redis.ttl paste_id
		@paste = redis.get paste_id
		haml "%p This paste will expire in \#{@ttl} seconds.\n%pre= @paste"
end

post '/' do
	key = SecureRandom.hex(3)
	redis.pipelined do<commit_msg>set up production connection string for redis.<commit_after>require 'rubygems'
require 'sinatra'
require 'securerandom'
require 'haml'
require './lib/sinatra/redis/redis.rb'

enable :static

configure :development do 
	set :redis, 'redis://localhost:6379/0'
end

configure :production do
	set :redis, 'redis://redistogo:<EMAIL>:9107/0'
end
	
@title = 'Anonypaste: Get pasted.'
	
get '/' do
	haml :index
end

get '/:paste_id' do |paste_id|
		@ttl = redis.ttl paste_id
		@paste = redis.get paste_id
		haml "%p This paste will expire in \#{@ttl} seconds.\n%pre= @paste"
end

post '/' do
	key = SecureRandom.hex(3)
	redis.pipelined do
{'fraction_non_alphanumeric': 0.14324817518248176, 'fraction_numerical': 0.01551094890510949, 'mean_word_length': 4.274038461538462, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2377769', 'n_tokens_mistral': 465, 'n_tokens_neox': 429, 'n_words': 116}