This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gist contains a workflow for Editorial, an app for | |
writing plain text and markdown on iOS. | |
To import the workflow, copy the *entire* text of the gist, | |
then open Editorial and create a new workflow. | |
------------ BEGIN WORKFLOW ------------ | |
{ | |
"actions" : [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple installer script for using the Evernote SDK in Pythonista | |
# | |
# This script should be run from the root directory. In order to keep things | |
# tidy, it installs the module and all its dependencies in a directory named | |
# 'evernote-sdk'. In order to be able to import it, you have to add that to | |
# your import path, like this: | |
# | |
# import sys | |
# sys.path.append('evernote-sdk') | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple Evernote API demo script that lists all notebooks in the user's | |
# account and creates a simple test note in the default notebook. | |
# | |
# Before running this sample, you must fill in your Evernote developer token! | |
# | |
# This sample is part of the Evernote SDK and has been modified slightly for | |
# Pythonista, to take advantage of the clipboard and PIL modules. | |
# If there is an image in the clipboard when the script is run, it is attached | |
# to the sample note. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Variation of the 'Basic Scene' template that shows every | |
# touch in a different (random) color that stays the same | |
# for the duration of the touch. | |
from scene import * | |
from colorsys import hsv_to_rgb | |
from random import random | |
class TouchColors (Scene): | |
def setup(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
from time import time | |
import sound | |
MAX_DOUBLE_TAP_DELAY = 0.25 | |
class DoubleTapScene (Scene): | |
def setup(self): | |
self.last_touch_up_time = 0 | |
self.double_tap_start_time = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo of how to generate a list of prime numbers and cache them | |
# in a data file for fast access (using the marshal module). | |
def gen_primes(n): | |
# Source: http://code.activestate.com/recipes/366178-a-fast-prime-number-list-generator/#c19 | |
s = range(0, n+1) | |
s[1] = 0 | |
bottom = 2 | |
top = n // bottom | |
while (bottom * bottom <= n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import canvas | |
canvas.set_size(512, 512) | |
from_point = (10, 10) | |
cp1 = (40, 200) #control point 1 | |
cp2 = (350, 50) #control point 2 | |
to_point = (300, 300) | |
# Draw the actual curve: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple URL shortener using is.gd | |
# | |
# Save this script as 'ShortURL' in Pythonista and add the | |
# bookmarklet below to Safari. The result is copied to the clipboard. | |
# Bookmarklet: | |
# javascript:window.location.href='pythonista://ShortURL?action=run&argv='+encodeURIComponent(window.location.href); | |
import clipboard | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# iTC Sales Report Downloader | |
# When you run this for the first time, you'll need to enter your | |
# iTunes Connect login and vendor ID. You can find the vendor ID | |
# on the iTunes Connect website by navigating to "Sales and Trends"; | |
# it's the number next to your name (top-left). | |
CURRENCY = 'EUR' | |
RESET_LOGIN = False # Set to True to remove login from keychain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This script converts a Glassboard HTML archive to JSON. | |
Usage: | |
python glassboard2json.py glassboard_export/index.html -o output_file.json | |
Requirement: BeautifulSoup4 (bs4) |