Skip to content

Instantly share code, notes, and snippets.

@lmarburger
Created November 4, 2013 19:56

Revisions

  1. lmarburger created this gist Nov 4, 2013.
    71 changes: 71 additions & 0 deletions text-flip.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    #!/usr/bin/env ruby

    input = "%clipboard"
    subs = {
    " " => " ",
    "a" => "ɐ",
    "b" => "q",
    "c" => "ɔ",
    "d" => "p",
    "e" => "ǝ",
    "f" => "ɟ",
    "g" => "ƃ",
    "h" => "ɥ",
    "i" => "ı",
    "j" => "ɾ",
    "k" => "ʞ",
    "l" => "l",
    "m" => "ɯ",
    "n" => "u",
    "o" => "o",
    "p" => "d",
    "q" => "b",
    "r" => "ɹ",
    "s" => "s",
    "t" => "ʇ",
    "u" => "n",
    "v" => "ʌ",
    "w" => "ʍ",
    "x" => "x",
    "y" => "ʎ",
    "z" => "z",
    "A" => "∀",
    "B" => "q",
    "C" => "Ɔ",
    "D" => "p",
    "E" => "Ǝ",
    "F" => "Ⅎ",
    "G" => "פ",
    "H" => "H",
    "I" => "I",
    "J" => "ſ",
    "K" => "ʞ",
    "L" => "˥",
    "M" => "W",
    "N" => "N",
    "O" => "O",
    "P" => "Ԁ",
    "Q" => "Q",
    "R" => "ɹ",
    "S" => "S",
    "T" => "┴",
    "U" => "∩",
    "V" => "Λ",
    "W" => "M",
    "X" => "X",
    "Y" => "⅄",
    "Z" => "Z",
    "," => "'",
    "!" => "¡",
    "?" => "¿",
    "(" => ")",
    ")" => "(",
    "[" => "]",
    "]" => "[",
    "." => "˙",
    '"' => ",,",
    "'" => ","
    }

    text = input.split(//).reverse.map {|i| subs[i].nil? ? i : subs[i] }.join("")
    print "(╯°□°)╯︵ #{text}"