I’m impressed by how we can turn everyday jobs into automations and simple tools, so we don’t repeat ourselves, like here.
One of the things is card-bin lookup, I started to use in my everyday job when I became responsible for payment flow.
There are multiple websites available, or even our corporate database was available on my access. But nothing can compete with a few keystrokes quick lookup features. So instead of googling around and finding ad-full websites, I enjoy a few keystrokes.
Demo of the extension
I simply press Option ⌥ + Space
then type bin
, then Enter ↵
, then type bin number (which is the first 6 digits of a credit card number.)
Then the result appears on the screen. Cmd ⌘ + Esc
to immediately hide it. No mouse clicks, no hands moved! That’s the magic of working with keyboard navigation and keyboard accessibility. 🚀
Why Raycast + LLM?
I gpt used to using CLI & keyboard for lots of things, so I had a scripts folder in my locale (which is synched between all my computers) and I was using a toolset from there.
Things started to change with Alfred app. But I was still not so eager to port my scripts into Alfred compatible ones. Alfred was kind of cumbersome to use. Then after a few years of use of Alfred, Raycast came to the scene, as a disruptor of Alfred. Raycast’s community support and its compatibility with using scripts both with UI and CLI gives me the freedom.
Porting to Raycast was not an issue and it was just adding a few lines to the top of my script in most cases.
As a result, Raycast brings me the UI interaction ease and speed for most of the cases. And LLMs are next version of Google, so to make life easier these 2 gadgets are good companion.
How I did it?
I tried to find a utility or formula to determine bin rules, then I noticed there are thousands of bin definitions, so it’s not a headless job to find a rule. Then I tried to find a SQLite or CSV data source to quickly find a source, luckily I found a data file, which seemed correct for most of the cards, and it was not too old.
venelinkochev’s bin-list-data project
I added this source as a submodule into my project, which can be found here: Card Bin Lookup Extension..
I was able to write a script to parse this CSV file, but why not try vibe coding? :)
When I first tried, ChatGPT was not able to provide a performant script to get the results fast. Because the file was bigger than the usual size to work with CSV.
I redirected ChatGPT to write the query with widely-available unix commands, like grep, awk, cat. They’re both available in most systems and they perform well. After this query ChatGPT was able to give the result in single-shot. Then we played together to format it better with awk commands.
Before LLMs, it used to take maybe a few hours to play with commands to format output in desired format. I generally cannot get a good code output when I need a core logic set properly or when I ask about core concepts like NSSorting, objective-c etc, but this kind of parse & output tasks are easy to proceed with LLMs.
I’m still not fully open to use LLMs in professional or performant codes, because the output needs maintenance over time, but this might be a good fit to use LLMs to cast everyday tasks into tools, or automations.
By the way, we just store mandatory bin data in masked form, not full of the card data.
And I don’t think 0.18 seconds in M1 device is performant enough, but that’s enough for now.