TIL
Sometimes we learn stuff and we share it with you fine people.
Back to all blog posts
-
· Barry Hess · TIL
TIL: Fixing Broken Social Share Images in Twitter/X
I have an admission to make. Social share images for Pika were broken on Twitter/X, LinkedIn, and Apple Messages for months. And it made me sad.
But in the past few months we got it fixed. And that made me very happy!
-
· Barry Hess · TIL
TIL: Overriding Permalink Generation in FriendlyId
FriendlyId is a helpful Ruby gem that streamlines creating permalinks and slugs for Rails applications. In Pika we're using it to help with generating permalinks for blog posts and pages as well as slugs for tags. When a customer wrote in with a request to modify the behavior of these permalinks, I wasn’t sure how easy it would be to override the default behavior. Turns out it wasn’t too bad!
-
· Barry Hess · TIL
TIL: Fixing Broken Action Text Images in Atom Feeds
For a while now we've seen that images in our Pika atom feeds were not displaying in some feed readers. In fact, they weren't displaying in my own feed reader, which routes through Feedly. I was sad.
I spent a lot of time troubleshooting this. Compared our feed with a lot of atom and RSS feeds that worked. Eventually I came to a hair-brained idea: what if Rails's Action Text image display markup was confusing these feed readers?
-
· Barry Hess · TIL
TIL: Easily Support Gravatars in Rails
We’re building some software where we’d like to display avatars for email contacts even if they aren’t users of our software. While Gravatar is a relic of Web 2.0, we’ve found that there are still a significant number of people who have their email addresses in that system.
Here’s how I streamlined displaying an avatar for an email address if it exists in the Gravatar system.
-
· Patrick Filler · TIL
TIL: Listen for JavaScript events only once!
A common thing I find myself doing in Javascript is adding some event driven behavior that I only want to happen once. Let’s say I have a big button that starts the process of lowering a certain spy into a pool of certain doom — I don’t want a second button press to awkwardly start him back at the top again!
-
· James Adam · TIL
TIL: Tapback Keyboard Shortcuts
If you use Mac, and you use Messages on your Mac, you will probably know that in the not-too-distant past, simple reactions to messages were added: what Apple calls Tapbacks.
These are great for a quick way to say yes (or no, or WTF!?!), but they are a bit of a pain to actually send. You have you right-click on the message, then choose "Tapback...", then click the icon you want, and for a quick reaction, that's not exactly fast.
Well, imagine my delight when I learned today that you can send Tapback reactions using only your keyboard.
To send one in reply to the last message you recieved, just hit Cmd-T and then the numbers 1 to 6 to select the reaction.
-
· Matthew Lettini · TIL
TIL: Use touch-action: manipulation; to avoid double-tap-to-zoom
Recently we built and launched A Good Enough Guestbook, a place where you can send us doodles and they’ll print out on our little printer. It’s quite lovely and fun, and you should send us a doodle. We might also have more in store for these printers in the future.
In the meantime, it took a bit of finagling to get the doodle interface feeling just right. One issue we ran into was that users would sometimes tap “Undo” a whole bunch in rapid succession. This undo’d just fine, but on mobile devices it would also unexpectedly zoom the page in. While this is often a good accessibility behavior of double-tapping a webpage, it’s unwanted in this interface.
-
· Barry Hess · TIL
TIL: Rails has_one Nested Attributes Tweaking
In a project I'm working on right now I've been using a Rails nested form and a couple of things caught me off guard.
-
· Matthew Lettini · TIL
TIL: System Colors are supported in CSS, but they’re unreliable
I’ve said this before: We’re primarily a web shop here at Good Enough, but occasionally we come up with ideas that we think would work really well as a native desktop or mobile application. Still, we prototype those ideas on the web first.
Recently, I wanted to try and make one of these web prototypes look and resemble a native Mac app as much as possible. My first inclination was just not to use any CSS at all, but that’s pretty limiting. Then I found CSS System Colors.
-
· James Adam · TIL
TIL: Turbo Stream and personalised content
Hotwire and Turbo are great for very quickly and easily adding real-time updating of webpages without requiring the browser to reload the whole page.
But if the information you want to stream back from your server to the client has anything specific to the current user — like using the name "You" instead of "James" — you might hit an issue. So far I haven't found this written up on the web anywhere, so hopefully this will help someone else with the same problem.