厭倦了枯燥機械重複流水線的工做,天天時不時的被打斷,不知道何時就被人圈到一羣裏,而後就要緊急支持一個事情。支線任務實在太多,晨會規劃的主線任務實在沒時間作,並且不少事邏輯負責,上下文切換成本過高,工做效率低下,還容易出 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能夠用。
本次活動耗費了一兩天的時間,後面還須要發貨,成本很是高。沒有一個顆頑皮的心,仍是不要玩這個了。