jarrodwhaley.com

I make films. I'm also a nerd.

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 »

Facebook Caching Data Not Even Given to Them

Pierluigi Paganini of Security Affairs:

Facebook is analyzing thoughts the writing [sic] that users have intentionally chosen not to share.

The article claims that when a user begins to type something into the status update field and then changes her mind about sharing it (or in other words, censors herself), Facebook actually keeps that text and runs data analysis on it.

I don’t know if it’s fair to say that Facebook is “analyzing thoughts,” exactly, and I don’t think there’s any reason to think that any interaction with Facebook at all is in any way connected with anything even remotely related to privacy. My sense is that humanity as a whole seems eager to do away with the very notion of privacy, so who cares?

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!

Everything Is In The Tiniest Things

Think about what you are, for a minute. Think about what it means to be aware of the fact that you are everything that you are–while fully knowing that you are only a cloud of particles that are attracted to one another by electromagnetic bonds. You’re a boundless part of everything; every thing is part of one boundless, unknowable, breathtakingly beautiful Everything.

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.

Hot Sauce Review: Who Dares Burns, The 2nd Assault

I got an opportunity to try a potent hot sauce last night, and it knocked me on my ass. Who Dares Burns! The 2nd Assault! is possibly the hottest substance I’ve ever encountered. Let me put that remark into context by saying that I’m no wimp when it comes to spicy food; I’ve been known to munch fresh habanero peppers the way other people eat popcorn. Go give that a try while considering the fact that this sauce nailed me to the wall, and you’ll begin to get some vague idea as to how hot the stuff really is. The label specifies that one drop is enough to substantially heat up a pot of chili. It informs us that this sauce is to be used only in recipes; it is not meant to be consumed on its own. It must be diluted. You get the idea.

more »

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.