jarrodwhaley.com

I make films. I'm also a nerd.

Posts in technology:

A Flexible Random Number Generator on iOS

My girlfriend manages a retail store on the Web, which entails a lot of marketing via social media. She likes to run a weekly promotion on Facebook in which a prize is awarded to a randomly selected “liker”1. When she first conceived the idea, she didn’t really have a means of properly choosing a winner with any real amount of randomness2, so I thought I’d cook up a little Python script. I realized that something like this would be a handy little utility for my own purposes, and I also knew my girlfriend would be asking for random numbers with some degree of regularity. Those two conditions being the case, I decided I’d like to write something that could be easily fired from an iPhone or an iPad with minimal effort. The script below meets those requirements fairly well, I think.

more »

Android Flashlight App LoJacks Users

Alice Truong, Fast Company:

The Android app Brightest Flashlight has been installed between 50 million and 100 million times, averaging a 4.8 rating from more than 1 million reviews. Yet its customers might not be so happy to learn the app has been secretly recording and sharing their location and device ID information.

I’m willing to bet a non-negligible amount of money, actually, that the number of shits given among those who’ve installed this app is less than or equal to 0.01. These users will never even know that their movements are filling a creepy database, and they wouldn’t care a whit even if they did know.

QuickReminder v. 2.0

I’ve updated my QuickReminder script for Pythonista to version 2.0, and it comes with a couple of cool improvements. Now, when the script begins to run, you’ll be prompted via a native iOS alert to either schedule the reminder or cancel it entirely1. The script will also return you to Drafts2 once your reminder is successfully set.

I have a lot of ideas for further improvements, so stay tuned. If you’d like to grab it, check out the gist.


  1. I’ve found on many occasions while running the script that I’d say, “oops,” and need to kill the notification so I could reschedule it, etc. 
  2. Required under my implementation, but it ought to be fairly simple to launch it with Launch Center Pro, for example. 

Easy URL Encoding on iOS

Occasionally it’s necessary to encode some text on iOS for easy insertion into a URL. It’s annoying enough trying to type out all of that word%20word%20word%20word gobbledegook, and it’s particularly painful trying to do so on an iPhone, since you have to dig down to the third keyboard in order to get to the % character. I came up with a couple of easy solutions to the problem using Drafts, TextTool, and Editorial.

  • The first method is a Drafts URL action which will send the text of the current draft to TextTool, properly encode the text for use in a URL, and then send the text back to a blank entry in Drafts:
    texttool://x-callback-url/transform?text=[[draft]]&method=encode&x-success={{drafts://x-callback-url/create?text=[[output]]}}
    
  • The second method is a workflow for Editorial which uses a Python script to replace the selected text with a URL-encoded version of the selection. Just install that workflow and fire at will.


UPDATE, 4:21 PM: Over on ADN, Jeff Mueller posted a handy permutation of my Drafts action for Launch Center Pro:

texttool://x-callback-url/transform?text=[clipboard]&method=encode&x-success={{launchpro:}}

Thanks, Jeff!

Get a List of the URL Schemes Supported on Your Mac

From a post on Macworld’s hint forums comes this very helpful tip: paste the entirety of the block below into a terminal window and get a full list of URL schemes on your machine, with each entry prepended by the app to which the handler is registered.

find /Applications /System/Library/CoreServices -not \( -name '*.lproj' -prune \) -name '*.app' |
while IFS= read app; do
    apps="${app//\//\\/}"
    plutil -convert xml1 -o - "$app"/Contents/Info.plist |
        sed -nEe '/<key>CFBundleURLSchemes<\/key>/,/<\/array>/ s/^.*<string>(.+)<\/string>/ \1:'" $apps/p"
done |
sort

Super handy.

Amazon Web Services Announces Cloud GPU Processing

RedShark News:

[T]his week, Amazon announced that it is going to include access to Physical GPU processing from within its virtual machines. Which means that from now, it will be possible not just to store video in the cloud, but to do heavy-duty processing on it as well.

It’s not too crazy, maybe, to imagine a not-very-distant future in which I can make a quick tweak to a cut or a color correction on a feature film from an airplane on my phone. That’s just nutballs.

HT Alonso Mejía.

How To Use Ruby 1.8 on OS X 10.9 Mavericks

The upgrade to 10.9 Mavericks has been mostly free of headaches for me, with one notable exception–Apple quietly updated Ruby to version 2.0, which has unfortunately resulted in some broken scripts that I depend on every day. Even more unfortunately, I don’t really know much about Ruby. I’ve tweaked other people’s code to my liking here and there, but there are a lot of things about it I just haven’t yet had the time to learn about. This combination of circumstances left me with a bunch of broken workflows and no idea how to fix them.

I got a chance to do a little searching this weekend, and I finally found the tip I was looking for thanks to a search on app.net; all one has to do in order to use Ruby 1.8 is to employ the following shebang in one’s scripts:

#! /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

Problem solved.

Thanks, Charles Parnot.

Google Patents Douchey Gesticulations

Chris Welch, for The Verge:

The patents outline an entirely new way of controlling Glass (or any other wearable computing device); one that tracks a user’s hand gestures in an attempt to understand what’s important or significant. One example cited puts a physical spin on the ubiquitous “like” action used across social media. Google’s patent shows a user framing real-world objects with a heart-shaped hand gesture. Using its built-in camera, the wearable device would then analyze the framed content and intelligently “like” the highlighted object or location.

Great. I can’t wait until the world is overrun with idiotic douchnozzles pointing their thumbs at everything. Kill me.

Finally! Rein In Loud TV Commercials With Terk VR1

You’re watching TV. The show you’re watching is at a comfortable volume. And then a commercial for some kind of facial “serum” bullshit comes across the airwaves1, and it’s so loud that you instantly lose control of your bladder. Surely the above scenario is familiar enough to any American, despite the fact that Congress supposedly did something to put an end to these shenanigans. It’s funny…the activities of Congress are usually so efficacious.

I’ve been looking for a solution to this problem for as long as I can remember. It’s one of those highly irritating things that heighten your blood pressure, and shorten both your life and the life of your TV2. Recently I decided I’d had enough, and I began researching hacky ways to take care of the problem myself. It turns out that there exists a simple $20 product called the Terk V13 that, when connected to your television, will balance out all audio and pipe it back out at a consistent volume. It sounds too good to be true, but it actually works.

You just pipe your audio through it using RCA cables, turn it on, and…that’s it. When you set the volume on your television, every sound will stay at that volume until you turn it up or down again. I haven’t touched the volume control on my TV for over a week—previously, I practically had to tape the remote to my hand.

I highly recommended that you buy one.


  1. Or through your cable, or over your WiFi signal, or whatever… 
  2. Wouldn’t you just love to fire a shotgun at that serum commercial, Elvis Presley style? 
  3. That’s an affiliate link. 

Wondering Why TextExpander Touch Needs To Access Your Reminders?

This has been a real head-scratcher for me over the past week as apps have been updating in advance of tomorrow's iOS 7 launch—why would TextExpander need permission to access my Reminders? Smile's blog explains that there's a very good reason:

When you update to iOS 7, you may find that TextExpander doesn't work in some apps which did work on iOS 6. Due to a change in iOS 7, those apps no longer have access to shared snippets. We have communicated with developers whose apps support TextExpander, and we've provided them an updated SDK with a new way to share snippet data.

In short, Apple has decided to break the way your snippets used to be shared between apps. Smile's solution is to store the data in your Reminders—because they're accessible even in the highly sandboxed environment of iOS. In a way, it's sad that developers have to figure out inelegant hacks like this one in order to provide basic functionality, but at the same time it does demonstrate the ingenuity of the developer community.

I wonder how many users will be refusing to give the app Reminders permissions and then writing support emails to Smile, complaining that the app doesn't work. What an (unavoidable) support nightmare.