<commit_before>#
# According to Wikipedia, Cheat can refer to:
#   Cheating, to take advantage of a situation by the breaking of accepted rules 
#     or standards
#   Cheating (casino)
#   Cheating in poker
#   Cheating in online games
#   In relationships, to have an affair
#   A cheat code, a hidden means of gaining an advantage in a video game
#   Cheating, parasitic abuse of symbiotic relationships
#   The Cheat, a character in the cartoon series Homestar Runner
#   Cheat!, a television show on the G4 network
#   The Cheat, a 1915 Cecil B. DeMille movie about a wealthy and domineering 
#     Asian gentleman taking advantage of an American female
#   Cheats, a 2002 comedy, starring <NAME> and <NAME>
#   Cheat, a song by The Clash from the UK version of their album The Clash 
#   Bullshit, sometimes known as "Cheat," a card game
#   An alternate term for defection in the prisoner's dilemma in game theory
#   Cheat River, a tributary of the Monongahela River in Appalachia; the Cheat 
#     starts in West Virginia, and flows westward
#   Cheat Lake, a nearby resevoir
#   Cheat Mountain, one of the highest mountains in the Alleghenies
#
%w[rubygems camping camping/db erb open-uri acts_as_versioned wrap diffr responder].each { |f| require f }
gem 'camping', '>=1.4.152'

$:.unshift File.dirname(__FILE__) + '/ambition/lib'
require 'ambition'

Camping.goes :Cheat

# for defunkt. campistrano.
if ARGV.include? '--update'
  ssh = 'ssh <EMAIL>'
  puts `#{ssh} 'cd /var/www/cheat; svn up'`
  system "#{ssh} 'sudo /etc/init.d/rv restart'"
  exit 
end

URL  = ARGV.include?('debug') ? 'http://localhost:8020' : 'http://cheat.errtheblog.com' 
FEED = 'http://feeds.feedburner.com/cheatsheets' # rss feed

module Cheat::Models
  class Sheet < Base
    validates_uniqueness_of :title
    validates_format_of     :title, :with => /^[a-z]+[a-z0-9_]*$/i
    validates_presence_of   :title, :body    
    before_save { |r| r.title = r.title.gsub(' ', '_').underscore.downcase }
    acts_as_versioned
  end

  class SetUpUsTheCheat < V 1.0<commit_msg>activerecord dependency, gemify ambition for cheat<commit_after>#
# According to Wikipedia, Cheat can refer to:
#   Cheating, to take advantage of a situation by the breaking of accepted rules 
#     or standards
#   Cheating (casino)
#   Cheating in poker
#   Cheating in online games
#   In relationships, to have an affair
#   A cheat code, a hidden means of gaining an advantage in a video game
#   Cheating, parasitic abuse of symbiotic relationships
#   The Cheat, a character in the cartoon series Homestar Runner
#   Cheat!, a television show on the G4 network
#   The Cheat, a 1915 Cecil B. DeMille movie about a wealthy and domineering 
#     Asian gentleman taking advantage of an American female
#   Cheats, a 2002 comedy, starring <NAME> and <NAME>
#   Cheat, a song by The Clash from the UK version of their album The Clash 
#   Bullshit, sometimes known as "Cheat," a card game
#   An alternate term for defection in the prisoner's dilemma in game theory
#   Cheat River, a tributary of the Monongahela River in Appalachia; the Cheat 
#     starts in West Virginia, and flows westward
#   Cheat Lake, a nearby resevoir
#   Cheat Mountain, one of the highest mountains in the Alleghenies
#
%w[rubygems camping camping/db erb open-uri acts_as_versioned wrap diffr responder ambition].each { |f| require f }
gem 'camping', '>=1.4.152'

Camping.goes :Cheat

# for defunkt. campistrano.
if ARGV.include? '--update'
  ssh = 'ssh <EMAIL>'
  puts `#{ssh} 'cd /var/www/cheat; svn up'`
  system "#{ssh} 'sudo /etc/init.d/rv restart'"
  exit 
end

URL  = ARGV.include?('debug') ? 'http://localhost:8020' : 'http://cheat.errtheblog.com' 
FEED = 'http://feeds.feedburner.com/cheatsheets' # rss feed

module Cheat::Models
  class Sheet < Base
    validates_uniqueness_of :title
    validates_format_of     :title, :with => /^[a-z]+[a-z0-9_]*$/i
    validates_presence_of   :title, :body    
    before_save { |r| r.title = r.title.gsub(' ', '_').underscore.downcase }
    acts_as_versioned
  end

  class SetUpUsTheCheat < V 1.0
{'fraction_non_alphanumeric': 0.09598432908912831, 'fraction_numerical': 0.010773751224289911, 'mean_word_length': 3.6846330275229358, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7336368', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1332, 'n_words': 502}