Skip to content

Instantly share code, notes, and snippets.

omz / gist:1102091
Created Jul 24, 2011 — forked from marcoarment/gist:1100959
Creating arbitrarily-colored icons from a black-with-alpha master image (iOS)
View gist:1102091
// Usage example:
// input image:
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
omz / gist:2134449
Created Mar 20, 2012
Highlighter plain text format
View gist:2134449
p. 4 | highlight | yellow
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
omz /
Last active Feb 3, 2021
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
# Google Search for Pythonista (iOS)
# Searches Google and copies the first result to the clipboard as
# a Markdown link in the form [title](url).
# Inspired by Brett Terpstra's SearchLink:
import clipboard
def google(terms):
View Top
# Shows a list of the 10 top paid apps on the App Store.
print 'Loading...'
import feedparser
import console
print 'Fetching Feed...'
feed = feedparser.parse('')
entries = feed['entries']
View Meme Generator
# Meme Generator 1
# Demonstrates how to draw text on images using PIL
# (Python Imaging Library)
# The script loads an image from the clipboard (or uses
# a default one if the clipboard is empty) and asks for
# two captions (top and bottom) that are then drawn onto
# the image.
import Image
View Meme Generator
import Image
import ImageChops
import ImageDraw
import ImageFont
import ImageFilter
import clipboard
def draw_caption(img, text, outline=2, top=False):
text_img ='RGBA', img.size, (0, 0, 0, 0))
draw = ImageDraw.Draw(text_img)
View Drum
#TODO: Adjust size to screen size (iPhone)
#TODO: Clear (and random, play/pause?) buttons
from scene import *
from sound import play_effect, set_volume, load_effect
from colorsys import hsv_to_rgb
import pickle
class DrumMachine (Scene):
def setup(self):
# Go to to create an app.
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
# access_type can be 'app_folder' or 'dropbox', depending on
# how you registered your app.
access_type = 'app_folder'
from scene import *
from random import randint, random, choice
from sound import play_effect
from colorsys import hsv_to_rgb
from math import sin
from functools import partial
from copy import copy
class Star (object):
def __init__(self):