Drupal Quick Tip: Easier “Archive” Filtering
I was working on a project today where we needed to show an archive of announcement nodes. The sidebar had to show a listing of months like this:
This is easy to accomplish by using the default Archive view that ships with Views, or by creating your own view that uses the same contextual filters, block and page. The contextual filter most typically used is Content: Created year + month. Here’s what the settings look like for this contextual filter:
Keyboard Maestro – Simple GUI for a Command-line App
Keyboard Maestro is now an integral part of my workflow throughout the day. I’ve found one particularly helpful use for it is to build very simple GUIs for command-line applications. In the example here I am showing how I use Keyboard Maestro to build a simple GUI for a Python script I wrote called dummyimage.py [see project on github]. Here’s the official description of the script:
Keyboard Maestro – Directory Prompt
Keyboard Maestro seems to have every option I can possibly think of, with the exception of “Prompt the user for a directory” or “Prompt the user for a file”. It is entirely possible I’m just missing it.
Here’s how I accomplish the directory prompt:
Chrome Extension: Hulu Easy Pop Out
In an earlier post, I mentioned that I had been frustrated with the Hulu user interface. The player window, by default, is just too large. Also it takes a few too many clicks to get to the Pop Out player.
I’ve written a Chrome extension to solve this problem. Check it out!
Here’s the official description:1234567Hulu's default player is rather large, and it takes a few too many clicks to get the pop out player window, right? This extension aims to solve this problem by letting you right-click a video's thumbnail to open the popout window immediately. As an added bonus it lets you set the default width and height of the popout.Note: It currently only works with some of the video types on Hulu, including Movies, Movie Trailers, TV Episodes, Clips, and possibly more. I've only tested this in the USA.If you get the popup but the video doesn't load, please check your flash configuration. One of my testers reported that he had to re-enable Chrome's built-in flash plugin.Thanks to the r/picrequests community and LAMcNamaraXVII (lamcnamaraxvii.deviantart.com) for the icon.
Finally Happy with an IDE
I’ve been using Vim (yes, their website is painful) almost exclusively as a tool for writing code since 2008. I’ve had many people tell me the benefits of using a good IDE, but have never felt comfortable leaving Vim (and leaving my keyboard, if you know what I mean). I love giving demonstrations and showing people the power of Vim. It’s a great editor, as you probably know.
Recently I started using PHP Storm and really liked what it offers. I do see the benefits of using an IDE. After a quick search I discovered IdeaVim, which is an incredible vim emulation plugin that works for PHP Storm. Its user rating is high, and let me tell you… it works very well. It even handles macros! I do still use Vim (the actual application) on my servers every day, but for anything that requires debugging or is more than “just a php file” I will fire up PHP Storm (where I now still have most features of Vim anyways).
I just installed PyCharm and WebStorm and don’t have much time with them yet, but I’ll try to find the time to update when I have mustered up an opinion of them. I did fire up, in PyCharm, a script I’ve been working on. Right away PyCharm informed me that I was using sys.exit() without first importing sys (the call was within a function that rarely gets used). Once I added import sys to my script I was also happy to see completion suggestions after typing “sys.“
Keyboard Maestro – Star current track in Spotify
I was exploring my options for starring the current track in spotify, but was coming up short. There is some work on some alfred workflows, but they either required a premium membership, or didn’t seem solid. It’d be nice to just use Applescript with a hotkey to star the track, but that’s not an action you can do with their library.
I realized that I now have Keyboard Maestro, and this is just the tool I need to accomplish my goal (hit CTRL-CMD-ALT-S to star the current track). The macro is a combination of Applescript (to get current track details and whether or not it’s starred), mouse clicks (as clean as possible, should work for everyone), if-then-else logic, application activation and notifications.
I’ve recently begun working with Keyboard Maestro and I’ve got to say, it’s one of the best applications I’ve ever used on a Mac.
I’m always excited to automate things, though usually with Python scripts. I rarely used Automator because it seemed somewhat limited and I didn’t care for the workflow building tools. Keyboard Maestro is quite a bit more powerful, and very intuitive. I cannot even believe the level of detail on all of the events and actions. I’ll spare you the details and just have you visit their site.
I’m going to create a new category on my blog for Keyboard Maestro macros, as I think you’ll be seeing a lot of them from me.