jarrodwhaley.com

I make films. I'm also a nerd.

Posts Tagged ‘Python’:

QuickReminder 3.0

I’ve made a few more improvements. I added input prompts so that a reminder can be easily scheduled from within Pythonista, so Drafts input is now optional. I also commented the code much more fully.

As usual, you can get the script at this gist.

randorando: a Simple Random Number Generator

Purely in service of scratching a personal itch, I wrote a very simple Web app that generates a random number within a set of numbers defined by the user. Enter the highest number in your set–the app assumes that the minimum is 0–and hit the Enter1 key. You’re then presented with your random number.

The app calls out to an API provided by random.org, a service which provides “truly” random numbers using a method based on radio sampling of atmospheric noise.


  1. A submit button appears if you visit on a smartphone, for convenience’s sake. 

QuickReminder v. 2.1

My QuickReminder script for Pythonista is now at version 2.1. I improved the way that certain errors were handled, making everything a bit more friendly to the user. I’ve also made a small tweak which throws an alert when no time interval is specified, then relaunches Drafts, preserving the original reminder text.

You can always grab the newest version of the script from this gist.

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 »

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. 

Digital Dead Drop is a Secure Web Notepad

Inspired by the Ender’s Game books, Tyler Spilker has written a dead-simple Python-based Web app called Digital Dead Drop; it’s designed to run on a local or remote server, and provides a quick and secure method with which to jot down a few thoughts and save them on the server side. Nothing is stored locally, so there’s no problem if your phone is lost. It’s a pretty cool idea.

Schedule Quick Reminders on iOS in Seconds

I’ve recently started learning Python, and in the process I’ve become a huge fan of a Python coding environment for iOS called Pythonista. It allows one to actually run scripts on an iPhone or an iPad, and given the fact that it has a great URL scheme, some really cool things are possible.

I decided last night that I’d try to create a means with which to easily send myself reminders on my iOS devices, using a Pythonista script and Drafts. The script takes minimal textual input from Drafts in the form of a note on one line and an interval of time (in minutes) on the second line. I fire a Drafts action, and that’s it. At the appointed time, I’ll receive a native iOS notification containing my reminder.

I find it really handy: there’s no need to fumble with Reminders.app, set a date and time, etc. And it’s also far, far quicker than trying to set a timer in Clock.app.

If you have both Drafts and Pythonista on your device(s), give it a shot. The relevant code, the Drafts URL action, and more can be found in my post on the Pythonista user forums.


UPDATE, July 18, 2013 9:56 PM: Version 1.1 tweaks the script to add an audio notification upon successful creation of a new reminder.