• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Notes to Self

  • Aviation Weather from NOAA Plugin
    • KZZV
    • Bad Shortcode
    • Simple Metar
  • Meetings

Mark Chouinard / October 30, 2014

Stupid Developer Tricks

¿uʍop ǝpısdn ǝdʎʇ oʇ ǝ|qɐ ǝq oʇ ʇuɐʍ noʎ os

#!/usr/bin/perl

use strict;
use warnings;
use utf8;

binmode(STDOUT, ":utf8");

my %flipTable = (
    "a" => "x{0250}",
    "b" => "q",
    "c" => "x{0254}", 
    "d" => "p",
    "e" => "x{01DD}",
    "f" => "x{025F}", 
    "g" => "x{0183}",
    "h" => "x{0265}",
    "i" => "x{0131}", 
    "j" => "x{027E}",
    "k" => "x{029E}",
    "l" => "|",
    "m" => "x{026F}",
    "n" => "u",
    "o" => "o",
    "p" => "d",
    "q" => "b",
    "r" => "x{0279}",
    "s" => "s",
    "t" => "x{0287}",
    "u" => "n",
    "v" => "x{028C}",
    "w" => "x{028D}",
    "x" => "x",
    "y" => "x{028E}",
    "z" => "z",
    "A" => "x{0250}",
    "B" => "q",
    "C" => "x{0254}", 
    "D" => "p",
    "E" => "x{01DD}",
    "F" => "x{025F}", 
    "G" => "x{0183}",
    "H" => "x{0265}",
    "I" => "x{0131}", 
    "J" => "x{027E}",
    "K" => "x{029E}",
    "L" => "|",
    "M" => "x{026F}",
    "N" => "u",
    "O" => "o",
    "P" => "d",
    "Q" => "b",
    "R" => "x{0279}",
    "S" => "s",
    "T" => "x{0287}",
    "U" => "n",
    "V" => "x{028C}",
    "W" => "x{028D}",
    "X" => "x",
    "Y" => "x{028E}",
    "Z" => "z",
    "." => "x{02D9}",
    "[" => "]",
    "'" => ",",
    "," => "'",
    "(" => ")",
    "{" => "}",
    "?" => "x{00BF}", 
    "!" => "x{00A1}",
    """ => ",",
    "<" => ">",
    "_" => "x{203E}",
    ";" => "x{061B}",
    "x{203F}" => "x{2040}",
    "x{2045}" => "x{2046}",
    "x{2234}" => "x{2235}",
    "r" => "n",
    " " => " "
);

while ( <> ) {
    my $string = reverse( $_ );
    while ($string =~ /(.)/g) {
	print $flipTable{$1};
    }
    print qq(n);
}
sudo mv flip.pl /bin/
sudo chown yourusername /bin/flip.pl && sudo chmod +x /bin/flip.pl

>perl PATH/flip.pl

Filed Under: Command Line Tagged With: upside down text

Primary Sidebar

Post Archives

  • June 2024
  • December 2022
  • July 2022
  • December 2021
  • October 2021
  • June 2021
  • February 2021
  • October 2020
  • September 2020
  • August 2020
  • March 2020
  • February 2020
  • December 2019
  • September 2019
  • June 2017
  • May 2016
  • April 2016
  • March 2016
  • September 2015
  • August 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • June 2013
  • May 2013
  • April 2013
  • February 2013
  • January 2013
  • December 2012
  • January 2011

Footer

Copyright © 2025 · machouinard · Log in