TIL A repository of TIL snippets on small things I learn day to day across a variety of languages and technologies. Categories CSS Database Infrastructure Life Rails Regex REST Ruby Security CSS Emails should use inline CSS Breakpoints are not as useful in emails Database MySQL does not support partial indexes MySQL does case insensitive string comparison by default Infrastructure Manage Heroku environment variables Life Always be learning Rails Rails will perform caching on all SQL queries Deep munging your params Find or create with additional attributes Regex Easy way to look for duplicate lines in a sorted file REST 201 Created should respond just with an header Ruby Memoization can be tricky when false or nil Converting strings to integers is tricky business Security Constant time comparison helps prevent attacks Stress your code and put it under siege Cookie's SameSite options can be confusing