store some dead code in the attic
Ted Unangst tedu@tedunangst.com
Mon, 02 Dec 2019 01:37:36 -0500
1 files changed,
0 insertions(+),
77 deletions(-)
jump to
M
skulduggery.go
→
skulduggery.go
@@ -21,86 +21,9 @@
"github.com/mattn/go-runewidth" ) -// these lists are mostly (?) accurate -var bigboldshitz = "๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐" -var lilboldshitz = "๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ" -var moeboldshitz = "๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ" -var morboldshitz = "๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐" -var biggothshitz = "๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ " -var lilgothshitz = "๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐" -var moegothshitz = "๐๐ ๐ฎ๐๐๐๐๐ณโ๐๐๐๐๐๐๐๐โ๐๐๐๐๐๐๐๐ " -var morgothshitz = "๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท" -var bigitalshitz = "๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐" -var lilitalshitz = "๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐" -var moeitalshitz = "๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐" -var moritalshitz = "๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ" -var bigbangshitz = "๐ธ๐นโ๐ป๐ผ๐ฝ๐พโ๐๐๐๐๐โ๐โโโ๐๐๐๐๐๐๐โค" -var lilbangshitz = "๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ" -var bigwideshitz = "๏ผก๏ผข๏ผฃ๏ผค๏ผฅ๏ผฆ๏ผง๏ผจ๏ผฉ๏ผช๏ผซ๏ผฌ๏ผญ๏ผฎ๏ผฏ๏ผฐ๏ผฑ๏ผฒ๏ผณ๏ผด๏ผต๏ผถ๏ผท๏ผธ๏ผน๏ผบ" -var lilwideshitz = "๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ๏ฝ" -var bigblokshitz = "๐ ฐ๐ ฑ๐ ฒ๐ ณ๐ ด๐ ต๐ ถ๐ ท๐ ธ๐ น๐ บ๐ ป๐ ผ๐ ฝ๐ พ๐ ฟ๐๐๐๐๐๐ ๐๐๐๐" -var evenmoeshitz = "๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐" -var evenmorshitz = "๐ถ๐ท๐ธ๐น๐๐ป๐ฐ๐ฝ๐พ๐ฟ๐๐๐๐๐ธ๐ ๐๐๐๐๐๐๐๐๐๐" - -var re_alltheshitz = regexp.MustCompile(`([` + - bigboldshitz + lilboldshitz + - moeboldshitz + morboldshitz + - biggothshitz + lilgothshitz + - moegothshitz + morgothshitz + - bigitalshitz + lilitalshitz + - moeitalshitz + moritalshitz + - bigbangshitz + lilbangshitz + - bigwideshitz + lilwideshitz + - evenmoeshitz + evenmorshitz + - bigblokshitz + - "][ '\ufe0f]?){3,}") - -var allUppers = []string{bigboldshitz, moeboldshitz, biggothshitz, bigwideshitz, moegothshitz, bigitalshitz, moeitalshitz, bigbangshitz, bigblokshitz, evenmoeshitz} -var allLowers = []string{lilboldshitz, morboldshitz, lilgothshitz, lilwideshitz, morgothshitz, lilitalshitz, moritalshitz, lilbangshitz, evenmorshitz} var skinTones = "\U0001F3FB\U0001F3FC\U0001F3FD\U0001F3FE\U0001F3FF" var re_moredumb = regexp.MustCompile("[\U0001f44f\U0001f6a8\U000026a0][" + skinTones + "\ufe0f]*") - -// this may not be especially fast -func unpucker(s string) string { - fixer := func(r string) string { - x := make([]byte, len(r)) - xi := 0 - loop1: - for _, c := range r { - xi++ - if c == ' ' || c == '\'' { - x[xi] = byte(c) - continue - } - for _, set := range allUppers { - i := 0 - for _, rr := range set { - if rr == c { - x[xi] = byte('A' + i) - continue loop1 - } - i++ - } - } - for _, set := range allLowers { - i := 0 - for _, rr := range set { - if rr == c { - x[xi] = byte('a' + i) - continue loop1 - } - i++ - } - } - x[xi] = '.' - } - return string(x) - } - s = re_alltheshitz.ReplaceAllStringFunc(s, fixer) - - return demoji(s) -} func demoji(s string) string { s = re_moredumb.ReplaceAllString(s, ".")