Skip to content

Instantly share code, notes, and snippets.

View LucasCioffi's full-sized avatar

Lucas Cioffi LucasCioffi

  • Scarsdale, NY, USA
View GitHub Profile
@LucasCioffi
LucasCioffi / example_controller.rb
Last active April 18, 2019 05:25
Here's a controller action you could insert into a Rails project. Accept a block of text and transform it into the language of Fake Grimlock. http://fakegrimlock.com/ Creative Commons Attribution License 3.0.
def fake_grimlockify
if params[:text].present?
@text_output = ""
params[:text].split(" ").each do |word|
if word.size > 4
@text_output += word.singularize.upcase + " " #.force_encoding('UTF-16').gsub("\xE2\x80\x99","").force_encoding('UTF-8')
else
@text_output += word.upcase + " " #.force_encoding('UTF-16').gsub("\xE2\x80\x99","").force_encoding('UTF-8')
end