• Tech Tips

    Quick Search Results using Raycast and DDGR

    This is more or less a proof of concept. I wanted a fast way to look up facts without navigating away from what I’m working on.

    Using Raycast is a natural place to start given you can pull it up and make it go away with ease. I looked for extensions in the Raycast Store (they’re free, despite the name) that might help but nothing seemed to do what I wanted. The Wikipedia extension does a great job of pulling information but it’s not as useful if I want a quick fact like “zip code for Portland Maine”.

    Next I began looking for command line tools that return web search results. Googler came up as a top choice but the project has been archived. ddgr was the next one I came across; it works beautifully to return DuckDuckGo search results as JSON. I installed it with homebrew ( brew install ddgr ).

    Finally, I whipped up a quick Raycast script command that would accept an argument, use ddgr to get the top search results, then spit them out in the Raycast output window. Raycast scrolls to the bottom of the output automatically, so I reversed the order of the top 10 results so that the most relevant appears at the bottom. That’s it!

    There isn’t any graceful error handling, automated test coverage, etc. Use it at your own risk. 😉

    Initial screen of RaycastSearching for Who is Derek Trucks?Search results

  • Development,  Tech Tips

    Handling Daylight Saving Time in Cron Jobs

    • Our business is located in Maine (same timezone as New York; we set clocks back one hour in the Fall and ahead one hour in the Spring)
    • Server A uses ET (automatically adjusts to UTC-4 in the summer, and UTC-5 in the winter)
    • Server B uses UTC (not affected by Daylight Saving Time) – we cannot control the timezone of this server

    We want to ensure both servers are always referencing, figuratively, the same clock on the wall in Maine.

    Here’s what we can do to make sure the timing of cron jobs on Server B (UTC) match the changing times of Server A (ET).

    Only one of the php artisan scrub-db  commands will execute, depending on the time of year.