Stay updated with my Atom feed or explore specific categories like tech by clicking on a tag. Check all tags here — each tag has its own Atom feed!
CSS has a clamp function that takes a min value, "preferred" value and a max value.
If the preferred value is between min and max, then the preferred value is returned, otherwise the output is clamped based on min and max.
I used this recently on the astro rewrite of this blog while setting margin for my "See all posts" CTA so that it's dependent on viewport size such that it never goes out of the viewport and smoothly goes inside the viewport as we resize.
margin-right: clamp(-25.5px,calc((900px - 100vw) / 2 - 10px),0px);
Ref: clamp() - CSS | MDN
Use the command
vim "+norm Go" "+startinsert" $filename
to automatically move at the end of the file and start editing.
This is useful when you are invoking vim from another script i.e. when you don't want this to be the default behaviour but want it in a special case.
For me this was useful for my journal script which appends the current time
at the end of a file and opens the file and (now) automatically moves to the end
and goes to insert mode.
Query Language Reference (Version 0.7) | Charts | Google for Developers
QUERY function - Google Docs Editors Help
Google Sheets supports a QUERY function using which we can run queries on a range of data.
The Google Visualization API Query Language has a SQL-like syntax and exposes a variety of functions to work on the selected range.
For example,
The following query groups by date summing the values in column B. The query runs on the range A:B
=QUERY(A:B, "SELECT todate(A), SUM(B) GROUP BY todate(A)")
Why :< just why