Skip to content

Instantly share code, notes, and snippets.

@gomezcabo
Last active November 20, 2017 08:40
Show Gist options
  • Save gomezcabo/8fade2bcd0ee69b0dc7731bf330479bc to your computer and use it in GitHub Desktop.
Save gomezcabo/8fade2bcd0ee69b0dc7731bf330479bc to your computer and use it in GitHub Desktop.
Flip commands ¯\_(ツ)_/¯
#!/usr/bin/perl
use utf8;
use Data::Dumper;
if ($#ARGV + 1 < 1) {
print "\nUsage: angryflip something_to_flip\n";
exit;
}
binmode(STDOUT, ":utf8");
$input = join(' ', @ARGV);
@LETTERS = split('|', 'A|B|C|E|F|G|H|I|J|L|M|N|O|P|R|T|U|V|W|Y|Z| |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|y|z|1|2|3|4|5|6|7|8|9|0|.|,|\'|"|`|<|>|∴|&|_|?|¿|!|¡|[|]|(|)|{|}');
@FLIPPED = split('|', '∀|𐐒|Ɔ|Ǝ|Ⅎ|פ|H|I|ſ|˥|W|N|O|Ԁ|ᴚ|⊥|∩|Λ|M|⅄|Z| |ɐ|q|ɔ|p|ǝ|ɟ|ƃ|ɥ|ᴉ|ɾ|ʞ|l|ɯ|u|o|d|b|ɹ|s|ʇ|n|ʌ|m|ʎ|z|Ɩ|ᄅ|Ɛ|ㄣ|ϛ|9|ㄥ|8|6|0|˙|\'|,|,,|,|>|<|∵|⅋|‾|¿|?|¡|!|]|[|)|(|}|{');
$input = reverse $input;
for $i ( 0 .. $#LETTERS) {
$MAP{$LETTERS[$i]} = $FLIPPED[$i];
}
$flipped_input = '';
for my $c (split //, $input) {
if (exists $MAP{$c}) {
$flipped_input = $flipped_input . $MAP{$c};
} else {
$flipped_input = $flipped_input . $c;
}
}
$result = "(ノಠ益ಠ)ノ彡" . $flipped_input;
$command = "echo '$result'|clipit";
print $result;
system($command);
#!/usr/bin/perl
use utf8;
use Data::Dumper;
if ($#ARGV + 1 < 1) {
print "\nUsage: flip something_to_flip\n";
exit;
}
binmode(STDOUT, ":utf8");
$input = join(' ', @ARGV);
@LETTERS = split('|', 'A|B|C|E|F|G|H|I|J|L|M|N|O|P|R|T|U|V|W|Y|Z| |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|y|z|1|2|3|4|5|6|7|8|9|0|.|,|\'|"|`|<|>|∴|&|_|?|¿|!|¡|[|]|(|)|{|}');
@FLIPPED = split('|', '∀|𐐒|Ɔ|Ǝ|Ⅎ|פ|H|I|ſ|˥|W|N|O|Ԁ|ᴚ|⊥|∩|Λ|M|⅄|Z| |ɐ|q|ɔ|p|ǝ|ɟ|ƃ|ɥ|ᴉ|ɾ|ʞ|l|ɯ|u|o|d|b|ɹ|s|ʇ|n|ʌ|m|ʎ|z|Ɩ|ᄅ|Ɛ|ㄣ|ϛ|9|ㄥ|8|6|0|˙|\'|,|,,|,|>|<|∵|⅋|‾|¿|?|¡|!|]|[|)|(|}|{');
$input = reverse $input;
for $i ( 0 .. $#LETTERS) {
$MAP{$LETTERS[$i]} = $FLIPPED[$i];
}
$flipped_input = '';
for my $c (split //, $input) {
if (exists $MAP{$c}) {
$flipped_input = $flipped_input . $MAP{$c};
} else {
$flipped_input = $flipped_input . $c;
}
}
$result = "(╯°□°)╯︵ " . $flipped_input;
$command = "echo '$result'|clipit";
print $result;
system($command);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment