My learning diary

Dynamic Tooltips

I had a tooltip for a switch which contained 2 lines of text. The first line of the tooltip shows how users can fill the textarea field nearby. The second line reminds users to meet certain prerequisites before filling the field. My GovTech OSS buddy suggested shortening the tooltip depending on user interaction. At first, the tooltip looked like: <i class="..." uib-tooltip="Here's the one and only static tooltip!" tooltip-trigger="'click mouseenter'" ></i> uib-tooltip seems to come from UI Bootstrap.

Continue reading "Dynamic Tooltips"

Intercepting Angular Data Binding

I’ve two form switches. Let’s call them A and B. I had to program them such that: When A is off, disable and switch B off. When A is on, disable and switch B off. We can ignore backend logic because I programmed it such that if A is off, ignore B. So, how did I solve this? I intercepted the data binding with a directive. This may not be the best solution, but it was so convenient and intuitive to me!

Continue reading "Intercepting Angular Data Binding"

Data Wrangling

I managed to catch one of the NUS Hackers’ workshops, “Hacker Tools: Data Wrangling” by Julius. I got to learn many new things since I don’t use CLI for text processing. Julius’ slides are in his GitHub repo. Below is a very brief and dry summary of what is more important to me. If I “miss” something out, it’s likely because I remembered it before. This summary does no justice to the workshop, but I want to write them down here before I forget.

Continue reading "Data Wrangling"

Style Fixes 1

I discovered there were some unexpected styles for <code> and <pre> in this site. This is due to Foundation’s default styles. The inline code style was fine, but the same style applied to code blocks (i.e. <pre><code>...</code></pre>), and that was not fine. There was also insufficient margin and padding for the code blocks. I inspected the <code> elements. I found out that Foundation was the culprit. It has been styling the <code> elements on top of what Hugo has in store.

Continue reading "Style Fixes 1"

First Lighthouse Report for Jiayee.net

I ran my first Lighthouse report on this site. There’s a bunch of improvements to make. As of now, I managed to resolve some of them. I put up the links to the before and after Lighthouse reports at the end of this post. Please feel free to take a look at them. A summary of the improvements I made: Include lang attribute to the html element i.e. <html lang="en">. Added rel="noopener" to external links.

Continue reading "First Lighthouse Report for Jiayee.net"