厌倦了枯燥机械重复流水线的工做,天天时不时的被打断,不知道何时就被人圈到一群里,而后就要紧急支持一个事情。支线任务实在太多,晨会规划的主线任务实在没时间作,并且不少事逻辑负责,上下文切换成本过高,工做效率低下,还容易出 bug。javascript
工做的越久,支撑的业务也就愈来愈多。想到其余二三线公司的同窗或者是创业公司的同窗都早就不在写业务代码了,想一想本身的状态仍是很失落的,再看着一样三年醇的同窗都是专家,内心更是笑 cry 了。php
情绪仍是宣泄嘛,因此弄了一个卫衣来自嘲一番,主题curd boy
,本想怎么设计个 logo,想了下太难了,也太费时间。后面使用一个wordcloud
python 库来生成词云,而后重点突出下curd boy
更好体现了繁杂工做中的本质。html
我翻开本身的
git commit
一查,这代码没有年代,歪歪斜斜的每行都写着 "业务驱动" 四个字。我横竖睡不着,仔细看了半夜,才从字缝里看出字来,满本都写着两个词是 "CURD Boy"!
想有这个自嘲的确定不止我一我的,不如给群友么一块儿来制做,客服告诉我人越多越便宜,最后凑到了30人,而后被告知和5我的价格一个,感受被套路了,前面一直不说多少钱,原来别人的便宜是有阶梯的,到50人才能更便宜,真是白折腾了。并且还要承担衣服很差看被群里吐槽的风险。java
发起个活动真不容易,还要对接客服,还要对接有意愿买衣服的同窗,看你们喜欢什么款式。python
踩了个坑,商家不支持分别发货,只支持集中发给我一我的。因此我还须要把你们的衣服二次快递分发给你们。mysql
因此又弄了个表单收集你们的衣服颜色、尺寸和收货地址。运营的工做也真是枯燥,把商家的尺寸、颜色手动搬过来。nginx
还要督促你们填表,真是操碎了心,还不如5人成团了,哈哈。c++
虽然工做很枯燥, 我们总得给本身找点乐子吧. 其实挺 low 的,不过就是好玩嘛,curd boy
的事须要优雅么?git
首先,从 highlight.js
提取我经常使用的语言的关键字, 而后又随便搞了些我脑壳里立马能想出来的一些名词、函数等。而后给一些须要重点突出的词增长权重。web
<?php $map = [ "go" => " default func interface map struct chan else goto package switch const fallthrough if range type for import return var go defer", "java" => "false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else transient catch instanceof byte super volatile assert short package default double public try this switch throws protected public private module requires exports do", "python" => "and elif is global as in if from raise for except finally print import pass return exec else not with class assert yield try while del or def lambda async await", "php" => "and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include empty require_once do xor return parent clone use else print eval new catch exception default die require enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof yield finally composer var_dump strstr strlen array_map callback", "javascript" => "in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as true false null undefined NaN Infinity eval Promise", "c c++" => "unsigned long volatile static protected bool template mutable if public friend malloc realloc memchr memcmp memcpy memset do goto auto void enum else break extern using asm case typeid printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan", "shell" => "ls cd pwd kill ps top du alias ln awk cat tail ", "mysql" => "varchar distinct", "asm" => "add push mov rbp rsp eax add push mov rbp rsp eax" ]; $str = ""; foreach ($map as $k => $v) { $str .= str_repeat($k." ",5); $str .= $v." "; } $map = [ 2 => "cmake gcc make install yum wget curl php-fpm websocket pip tcp udp connect read write close select poll epoll stream", 3 => "Laravel Symfony SpringBoot strace netstat socket nginx", ]; foreach ($map as $num => $v){ $str .= str_repeat($v." ",$num); } $str .= str_repeat("CURD ",20); $str .= str_repeat("Boy ",20); file_put_contents("keywords.txt",$str);
pip3 install wordcloud pip3 install matplotlib
由于要去作衣服,因此我选择生成的是透明的 png, 由于生成图片各个单词的位置是随机的,因此我须要重复生成,而后选择一个curd
和boy
两个单词都比较居中的使用,因此生成的文件名就用时间戳。
#!/usr/bin/env python3 import wordcloud import time words = open("keywords.txt"); text = words.read(); w = wordcloud.WordCloud( width = 2363, height = 945, background_color = None, collocations=False, scale=3, max_words=400, max_font_size=380, mode='RGBA', margin=3, font_path='/System/Library/Fonts/Menlo.ttc', # colormap = 'tab20' ) w.generate(text) w.to_file('curd/'+ str(int(time.time())) +'.png')
colormap
能够控制单词的颜色变化, 通过尝试tab20
很好看,可是对底色的兼容性很差,好比我要印刷的衣服颜色比较多的话,就容易出现bug
了。
https://matplotlib.org/exampl... 查看 colormap 配色
while :; do php keywords.php && ./create.py ; done
循环不停的生成,而后我在“AI”制做的图片中挑选最符合我要求的那个,耗费了我大半天。
有兴趣的同窗也能够下载这个库玩玩。日常作PPT能够用。
本次活动耗费了一两天的时间,后面还须要发货,成本很是高。没有一个颗顽皮的心,仍是不要玩这个了。