Posts Tagged “ruby”

  • PodTagger: automatic ID3 tagging for podcasts

    I have a couple of podcasts (Systematic, Overtired) that I do my own editing on. To save Moises over at ESN some time, I've been tagging the MP3 files. Not surprisingly, I decided I wanted to automate this process.…

  • CodeReminder: don't forget to play

    I put together a little utility this morning to help me remember what GitHub repositories I've grabbed with the intention of playing with later. I often clone or fork a repo and plan to explore it over a weekend, but then quickly forget about it if I don't add a reminder.…

  • A launchd post scheduling system for Jekyll

    My previous post scheduling system revolved around the Unix at` command to schedule one-off future tasks. In the most recent version of OS X (10.10.4), that atrun command is utterly broken. Running `at`, `atq`, or `atrm will give you:…

  • Modifying Jekyll post data with inline tags

    This post will only be of interest to Jekyll users, but if you want to start creating your own customizations to your Jekyll setup, this will be an easy start.…

  • Reiki, a fix for my convoluted Rakefiles

    I just published project called Reiki, a shell function that I've been using to make it easier to run the various (and often overly complex) Rake tasks that I use in a lot of my projects. The headline should probably have been "a stopgap for my convoluted Rakefiles." To summarize, it turns:…

  • Automating OS X Automator scripting

    I write a lot of Services using Automator these days. They usually consist of one "Run Shell Script" action and possibly a few other Automator tasks. Editing a script in the Automator text fields is a horrible experience, so I end up doing a lot of copy-switch-pasting between my editor and Automator. This script lets me make the process simple.…

  • Bytes: file size conversion Service

    This will probably be part of SearchLink someday, but I decided to stop adding features and get that shipped as soon as possible (just have to rewrite most of the documentation). So here's this piece of it as a Service and a CLI.…

  • The MatchData object in Ruby gsub blocks

    I use regular expressions in Ruby a lot. One of the features I've come to use frequently is the block syntax for gsub` calls. Whereas the other syntaxes for `gsub really only provide back referencing for capture groups in replacements, the block syntax allows much more flexibility.…

  • TagBak, tag backup and restore

    I mentioned a few days ago that there were a few ways to lose your tags in OS X. I began working on the best solution I could come up with for now: TagBak.…

  • How to lose your tags

    First, Happy July 4th! I was going to take today off from everything, but woke up early with a bug to do some more OS X tagging research. I'll go back to bed after this...…

  • Install SearchLink without the Terminal hassle

    I just wanted to drop a quick note to let everyone know that SearchLink can now be installed without any command line mucking around. It's just a matter of downloading and double-clicking to enjoy all of the SearchLink magic.…

  • Folderize - Sync nvALT notes to nested folders

    This script is designed for people who want to sync a flat folder of notes (a la nvALT) to a more organized system of nested folders. It serves as a system for creating a structure that's easier to navigate in iOS note apps, or for separating notes that might be compiled into different books or projects.…

  • Web Excursions for April 14, 2014
  • A Service for getting sums from selections

    Here's a quick System Service for OS X that finds all the numbers in selected text and adds them together. I find myself making lists of numbers in Markdown quite a bit, and often just want to add them all together. That's what this does.…

  • Dash docsets from MultiMarkdown

    Dash is my favorite way to reference syntax and info about dozens of programming languages, and one of my most used applications. The developer of Dash recently released "Cheatset", a way to build your own Cheat Sheets to display in Dash as docsets, complete with indexed commands and categories.…

  • Automatic filing with Hazel and Mavericks tags

    I've finished a tag-based filing system I started working on before Mavericks. I personally think it's flexible enough to be shared, but others may balk at the apparent complexity. It does take some planning and setup, but it's an effective way for me to manage files.…

  • Icon Grabber updated to search any platform

    I've updated the icon grabber script to allow you to specify what type of application you're looking for, be it iPhone, iPad or Mac. In case you're not familiar, this script uses the iTunes API to locate the highest resolution icon for an application based on a search query. It previously always assumed "iPad."…

  • Planter 2.0 with Mavericks tagging

    I've finished the biggest update to Planter thus far, and bumped it to version 2.0. I don't know how popular this project is or ever will be, but I still find it useful enough to keep in good shape.…

  • Top RAM processes Geeklet Mavericks fixer upper

    For those of you using the memmeter.rb Geeklet to display your top RAM processes on your Desktop, I've updated the script located here with a version compatible with Mavericks and Ruby 2.0.…

  • "Lazy" Markdown reference links

    This allows you to not bother naming or numbering links while writing, and easily move links along with their paragraphs without breaking numbering sequences or naming conventions.…

  • SkypeCall extension for PopClip

    I recently added a PopClip extension for dialing Skype to my collection. It scans selected text for a 7 or 10-digit phone number, offering a Skype button in the PopClip popup if it finds one. When activated, it dials the first match in the selected text.…

  • nvremind: Automatic reminders for nvALT

    Inspired by Evernote, I whipped up a little script to find "@reminder" tags with date parameters in nvALT notes (or any folder of text files). It can generate notifications or send HTML emails at the specified time. It's just for fun right now, but I thought I'd put it out there to see if anyone had any ideas for it.…

  • Planter 1.3 with File Templates

    I've updated Planter to 1.3 with a few new features. Previously, it created directory structures based on tab-indented folder trees in plain text, using either the command line or LaunchBar (original post, and the LaunchBar version). Now, it handles file templates as well as slightly more advanced variables.…

  • Instantly grab a high-res icon for any iOS app

    As a blogger who writes about a lot of apps, I frequently need to grab artwork for iOS apps. iTunes and its web previews don't make this an easy task, especially for high-res versions. To assist in this process, I wrote a quick script to allow me to search for an iOS app by name and instantly write its 1024px version (or the highest resolution available) to the current directory in Terminal. There's also an OS X application version at the end of this post, so you can perform this trick without…

  • Scripting Jekyll image "uploads"

    As I start blogging more with Jekyll, I find that manually placing the images in my source folder and typing out the resulting urls is a bit cumbersome. I know a lot of people have come up with solutions for this, but it was simpler to roll my own in the end. I've created a few ways of doing this on OS X. All of these methods will copy the image to an appropriate, date-based subfolder in your static blog's source, optimize it if the tools are available and immediately place Markdown image urls…

  • Mass creating TextExpander snippets

    I ran into a situation yesterday where I wanted to create over a thousand TextExpander snippets. I won't go into detail about why, but I thought I'd share my solution. In my case, I was working with a huge CSV file where one field would be the abbreviation and another would be the expansion. The script I'm sharing below only works with CSV files containing two fields (abbreviation, expansion), but it can easily be extrapolated to work with much more complex sources of data.…

  • Previewing Jekyll posts with Marked

    If you use both Marked and Jekyll (or Octopress), you may want to preview your posts accurately in Marked before publishing. The first obvious step is to link your screen.css file as a Custom Style:…

  • Jekyll plugin for quick "donate" buttons

    I'm still working on the Jekyll version of this site. It's coming along. Along the way I wanted a better-looking donation button, so I wrote a quick plugin to handle a donate Liquid tag:…

  • WordPress to Jekyll: converting gallery shortcodes

    As I move along with my Jekyll/Octopress transition, I'm working to make the move as clean as possible. I'm importing my WordPress database rather than starting fresh, and I'll be sharing tidbits of discoveries as I go. These posts will only be of interest to people making similar transitions, but they'll also be serving as notes for myself and Google search results for people up against the same conundrums.…

  • Search your Pinboard bookmarks with Launchbar

    This script is based on my Pinboard mirroring script that I use to keep Spotlight-searchable, OpenMeta-tagged copies of my Pinboard bookmarks locally. It's a good system, but I was thinking that a direct bookmark file search in Launchbar would be exponentially faster than Spotlight on the occasions that I remembered any part of the title.…

  • Planter: Tree planting for your filesystem

    I wrote a script this morning called "Planter." It plants directory trees. I made a logo for it not because it's an official project or deserving of the extra effort, but because I had Photoshop open anyway.…

  • A drop-in growlnotify replacement for Mountain Lion notifications

    I use the Growl Extra growlnotify in a lot of my scripts to offer notifications while they run in the background. It works great, and still works with Mountain Lion, but I have a thing for system integration and new shiny.…

  • Mountain Lion Notifications from Terminal with terminal-notifier

    Via a post on OneThingWell, I discovered a new Ruby library and accompanying CLI called terminal-notifier. It allows you to quickly interface with Mountain Lion's Notification Center from the command line. terminal-notifier will be available as part of the filesystem-watching tool Kicker, but you can put it to use as a general notification system for Terminal right now.…

  • wp_mangler, scripted post modification for WordPress

    Here's a quick script I was playing around with this morning. I want to do some extensive string handling on all of the posts in my WordPress database. It made the most sense to me to pull each post's content from the db, do the string mangling with a shell script and then replace the post_content field as I go. This script is destructive and any mistakes you introduce could kill your entire blog. Should you have a need for this script, back up first!…

  • A warm, fuzzy, file-finding feeling

    I write a lot of scripts. I often want to edit and tweak those scripts. I sometimes forget exactly where a script is in my path, though, so I end up using "subl $(which scriptname)" to do it (yes, I have an alias for that). I didn't know I needed a smarter, faster way until I built this, but now I'm quite enamored with it.…

  • Scatterbrains: git as biographer

    This is another of my attempts at keeping track of my day in an orderly fashion. It's a pretty simple idea. Given that most of of what I do is stored in git repositories, my commit logs are my best bet for seeing what I've accomplished each day. I just needed to pull them together and bundle them up without having to think about it. If a lot of your work happens in git repositories and you make frequent commits, this might be of use to you.…

  • Experiment: CSV to MMD tables with color coding

    This is a quick experiment with Google Docs, CSVs, MultiMarkdown tables and CSS3 selectors. It's really hackish, but it's a start. I wanted to take Google Docs spreadsheet output and turn it into a clean table with color coding and my own styling. Here's what I've done so far (example output here):…

  • Automating TaskPaper to Day One logs

    This is just a quick post to mention a new idea I had while working on Marked today. I was, as usual, using TaskPaper to organize the project and track my progress. I use a different TaskPaper file in the main folder for each project I have going. The last script I posted is effective enough, and I should probably leave well enough alone, but I had to try one other thing.…

  • "Open URLs" Dropzone Destination

    I just added a pull request for my latest Dropzone (review) Destination. It's called "Open URLs," and with it you can open text urls from any number of text files, drag text straight from any application, or just click it to scan your clipboard. The files, text or clipboard contents are scanned for any http(s) links and they're sent to your default browser using the system open command.…

  • Marked scripts: nvALT, Evernote, MarsEdit, Scrivener

    Thus far, Marked has had a great reception and has, overall, worked superbly with a wide range of text editors. I frequently get requests for integration with more complex editors, but have been unable to fulfill them because Marked requires an actual text file to watch. To try and fix this situation, I've been scripting "watchers" for various applications which embed their files inside of bundles or otherwise obscure the actual content files from Spotlight.…

  • The MindMeister Markdown Showdown

    I'd like to welcome Donald Curtis as a guest blogger today, here to talk about a very cool script we worked on to add some Markdown love to MindMeister. It started with a DM from Donald on Twitter with a link to a GitHub gist, and after some back and forth it became a very cool (and useful) tool. Cool enough that I really wanted to share it here. Since the script is his brainchild and almost entirely his handiwork, I thought it would be cool if Donald did the honors.…

  • Automating random giveaways, v1.0

    To pick the winners for the Yoink and Listary giveaways, I wrote an AppleScript to make the process completely random and as painless as possible for me. I still have plans for making a similar WordPress plugin, but that's still in the planning stages. For now, this is working quite well and I thought I'd share it. I doubt many people have the exact same setup and requirements, but the basic structure might be helpful for other projects.…

  • GVoice command line SMS revisited

    Thanks to a comment from Evaryont on the original SMS from the command line with Google Voice post, a problem that was causing Error 500s in the script has been solved.…

  • OTask: CLI for OmniFocus

    I've been sitting on this one for a while, until I got a request from Patrick regarding an OmniFocus CLI and LaunchBar. I thought it might be time to dig this up and post it.…

  • Watch for file changes and refresh your browser automatically

    After my epic three-part post on Saturday, I spent the rest of the weekend doing more "useful" things. Now it's Sunday night (Monday morning, I think), and I've got some kind of minor food poisoning which is currently keeping me awake. Thus a "hey, cool trick" post.…

  • Natural language date conversion for TextMate

    I've been flirting with a plain-text to-do system again. The biggest problem for me is that a plain text system opens up so many possibilities for fiddling and scripting. I always end up fiddling more than working when I try it. I don't see any reason this time would be different, but it's Sunday and I have some extra time on my hands after being snowed in today. So I'm fiddling.…

  • Dammit. Again with the Lipsum.

    I know, I said I was done with the Lorem Ipsum generators. Then Dr. Drang responded with a brilliant solution which doesn't require Internet access to generate some beautiful dummy text. I set it up and ran it myself, and loved the results. Then I found myself wanting to expand it to do more, such as multiple paragraphs, list items and other things I use regularly when making dummy layouts. The problem is that I'm only good for one-liners in Perl, and didn't want to take take the time to learn…

  • SMS from the command line with Google Voice

    I needed a script send an SMS today, and I found a very handy post at sudocode to send one via Google Voice, using PHP. I wanted to make it a little more command-line-friendly, so I rewrote it (ham-handedly) in Ruby and added some options parsing to it. It's designed for --- and only tested on --- OS X, but may work fine elsewhere.…

  • TextExpander: bit.ly with authentication

    A quick script in response to Donald's query on my TextExpander Experiments post. He wanted to know if I could make the bit.ly script which expands to a bit.ly-shortened version of a url in the clipboard work with an authenticated account, presumably for click tracking. Well, sure! Just adjust the script below to contain your bit.ly username and your API key (in lines 6 & 7), and replace the existing script in the TextExpander experiments bundle with this one (or create a new snippet with the…

  • Updated: Songza Lucky Link Service

    Songza.fm has moved to Songza.org, so I've rewritten the old Songza Lucky Link Service for Snow Leopard to match. This new version of the service runs without dependencies, so it should work for any Snow Leopard setup right out of the box. It's a bit silly, but what it does is take your selected text and run it as a query on Songza.org, parse for the first result (if there are any), shorten that link and insert it after your selected text. A fast, easy way to punctuate your obscure music…

  • A better System Service for Evernote clipping - with MultiMarkdown

    The fact that Evernote processes HTML so much better than it does plain or rich text got me thinking and tinkering. I use Markdown (actually, MultiMarkdown) constantly, and it does a great job of turning plain text into valid markup. With (Multi)Markdown, even plain text becomes HTML that--when imported into Evernote--retains most of its formatting. To answer your question, no, I'm not obsessed with Evernote, I'm obsessed with problems I think I could solve. It's unhealthy.…

  • A (fairly) simple equation evaluation service for Snow Leopard

    This is a stripped down version of a command I have in the TextMate bundle we use at TUAW. It allows you to select any basic numeric equation and evaluate it, replacing the selected text with the results. It will ignore your text if it contains anything but numbers and basic mathematical symbols. Sure, there are plenty of ways to do calculations in OS X (Spotlight, Launchbar, Quicksilver), but I've had more and more incidents lately where I just wanted to do quick calculations inline, so I…