{"id":2069,"date":"2020-12-27T22:55:22","date_gmt":"2020-12-27T22:55:22","guid":{"rendered":"https:\/\/sp2hari.com\/?p=2069"},"modified":"2020-12-30T19:10:19","modified_gmt":"2020-12-30T19:10:19","slug":"thank-you-generator","status":"publish","type":"post","link":"https:\/\/sp2hari.com\/index.php\/2020\/12\/27\/thank-you-generator\/","title":{"rendered":"Thank you generator"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This task\/project started with a simple comment from our team. Mindy (who is the EA to Vivek) shared this comment in one of the internal Google documents. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM-1024x249.png\" alt=\"\" class=\"wp-image-2071\" width=\"768\" height=\"187\" srcset=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM-1024x249.png 1024w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM-300x73.png 300w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM-768x187.png 768w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM-1232x300.png 1232w, https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/Screenshot-2020-12-28-at-2.30.51-AM.png 1372w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">It was very unusual to get a coding task from Mindy. Usually, whenever I&#8217;m assigned a coding task, it is for some customer or any feature I&#8217;ve worked on in the past. It sounded interesting and my first plan was to build a command-line tool. It felt it will be better to build something so that she can customize it later. For example, I didn&#8217;t want her to ping me again to choose a custom font, size, or color.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The two libraries that really helped me build this solution are <a rel=\"noreferrer noopener\" href=\"https:\/\/www.npmjs.com\/package\/text-to-image\" target=\"_blank\">text-to-image<\/a> (library to convert the text to png image) and <a rel=\"noreferrer noopener\" href=\"https:\/\/www.npmjs.com\/package\/gifshot\" target=\"_blank\">gifshot<\/a> (library to create gif animations from a set of images)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Demo Link at &#8211; <a href=\"https:\/\/sp2hari.com\/thankyou-generator\/\">https:\/\/sp2hari.com\/thankyou-generator\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The webpage has three simple text boxes. The first text box is a comma-separated list of the text which needs to be animated. The second text box is the config for the text-to-image package. The third text box is the config for the gifshot package.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/image.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"90\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/image.gif\" alt=\"\" class=\"wp-image-2072\"\/><\/a><figcaption>Sample image created using the text &#8220;Adios 2020!,Welcome 2021!&#8221;<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/image-3.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"90\" src=\"https:\/\/sp2hari.com\/wp-content\/uploads\/2020\/12\/image-3.gif\" alt=\"\" class=\"wp-image-2074\"\/><\/a><figcaption>The final image we used in our presentation deck.<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The entire code is available at <a href=\"https:\/\/github.com\/sp2hari\/thank-you-generator\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/sp2hari\/thank-you-generator<\/a>. It is always fun to build something real, quick and hacky! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This task\/project started with a simple comment from our team. Mindy (who is the EA to Vivek) shared this comment in one of the internal Google documents. It was very unusual to get a coding task from Mindy. Usually, whenever I&#8217;m assigned a coding task, it is for some customer &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-2069","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/2069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/comments?post=2069"}],"version-history":[{"count":9,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/2069\/revisions"}],"predecessor-version":[{"id":2081,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/2069\/revisions\/2081"}],"wp:attachment":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/media?parent=2069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/categories?post=2069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/tags?post=2069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}