Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
667 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. #!/usr/bin/env perl
  2. # decorate text by randomizing single characters inside of
  3. # <p class="centerpiece"></p> to different unicode bullety
  4. # things
  5. # i have no idea what is going on here
  6. use utf8;
  7. use open ':std', ':encoding(UTF-8)';
  8. use strict;
  9. use warnings;
  10. use 5.12.0;
  11. my @bullets = qw(
  12. ☆ ✢ ✣ ✤ ✥ ✦ ✧ ✩ ✪ ✴ ✵ ✶ ✨ ✮ ✯ ✺ ✾ ❦ ☙ ❂ ❃ ❉ ✿ ❀ ❁ ☼
  13. );
  14. # you could always swap these in for bullets if you wanted
  15. # an especially wintery effect:
  16. my @snowflakes = qw(
  17. ❄ ❅ ❆
  18. );
  19. while (<>) {
  20. s{(->|<p class="?centerpiece"?>)[ ]?(.)[ ]?(<-|</p>)}{
  21. "$1 " . $bullets[rand @bullets] . " $3"
  22. }eg;
  23. print;
  24. }