Danny Guo | 郭亚东
How to Add Copy to Clipboard Buttons to Code Blocks in Hugo
A small quality of life improvement for programming-related websites is to add copy to clipboard buttons to code blocks. When a visitor wants to copy a code example or a shell command, it’s nice to be able to just hit a button rather than manually select the text, right click, and press copy. I use Hugo to build my personal website. While Hugo has built-in support for syntax highlighting, it doesn...
MoMath Hackathon 2018: Vortex Pool
Two weekends ago, some friends and I went to the National Museum of Mathematics (MoMath) to participate in their second annual Expressions hackathon. The museum has many interactive exhibits, and two of them have SDKs. Dynamic Wall As soon as you enter the museum, there’s a big, animated wall on the right side. It’s made up of multiple slats that can move independently from each other. The top and...
Custom Website Selection Colors
CSS provides an easy way to style the user’s selected or highlighted elements using the ::selection pseudo-element. ::selection { color: white; background: purple; } /* for Firefox */ ::-moz-selection { color: white; background: purple; } Try it out: Note that background is a shorthand for multiple background-* properties, with background-color being the first one. Also keep in mind that you cann...
A Tribute to Kindle
I’ve been thinking about just how many digital devices I own. Excluding accessories like my keyboard, the full list is: Apple iPad (2017) Apple Macbook Pro (2015 13”) Amazon Echo Dot (2nd generation) Amazon Kindle Paperwhite (2nd generation) Google Home Mini Lenovo IdeaPad Y410p Microsoft Xbox 360 Microsoft Xbox One S Motorola Droid Turbo Raspberry Pi Model B Roku Premiere Samsung Galaxy S7 Of a...
Migrating from Jekyll to Hugo
I recently migrated my personal website (the source code is on GitHub) from Jekyll to Hugo. It was mostly painless, and now I’m eager to write more often and put more content on my website. I originally chose to use Jekyll because it’s supported by GitHub Pages. At the time, I also wasn’t aware of other static site generators, and Jekyll seemed to be widely used. But when I recently decided to put...