Skip to content

Instantly share code, notes, and snippets.

View kleerkoat's full-sized avatar

kleerkoat kleerkoat

View GitHub Profile
@sgerin
sgerin / ios_icons
Created August 19, 2013 03:18
Get iOS icons. Thanks to Brett Terpstra.
# Adapted from Brett Terpstra script: http://brettterpstra.com/2013/04/28/instantly-grab-a-high-res-icon-for-any-ios-app/
# Gets the 1024px version of an app icon and applies a rounded mask. The result is displayed in Pythonista's console, you can tap and hold to save or copy it.
# You may find odd result: try searching for both device categories.
# If you find any bug, you can find me @silouane20 on Twitter.
from PIL import Image
from StringIO import StringIO
import re
import requests
@epramono
epramono / RemindSomeone
Last active October 2, 2018 23:26
This action allows you to send an iMessage that embeds a custom URL scheme that would allow the recipient to add it as a new Reminder in Due, if she has Due installed and is willing to add the reminder. Simply create a new post in Drafts with the recipient's email address as the first line, and the reminder text that will be parsed by Due on the…
launchpro-messaging://x-callback-url/?
to=[[title]]&
body=[[body]]%0A%0A
{{due://x-callback-url/add?title=[[body]]}}
&x-success={{drafts://}}
@alessaba
alessaba / gist:6173177
Last active December 20, 2015 18:08 — forked from jwt2d/gist:6120070
# Launcher
#
# A Simple Launcher in Notification Center
from scene import *
import webbrowser,console,notification
#----------Launcher Settings---------------
key_names = [[['GChrome','googlechrome:'],
['Keeper','keeper:']],
[['Calculator','calculatorinfinity:']],
@temoto
temoto / helpers_data.py
Last active September 10, 2024 20:12
Part of py-helpers. Gzip compression shortcuts. Encoding. Database helpers. Retry decorator.
def namedlist(typename, field_names):
"""Returns a new subclass of list with named fields.
>>> Point = namedlist('Point', ('x', 'y'))
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain list
33
>>> x, y = p # unpack like a regular list
@epramono
epramono / CallSomeoneLater
Created August 5, 2013 09:26
This action will create a reminder in Due to call someone in your Contacts using Launch Center Pro's dial URL. The recipient name will be stored by the reminder into the clipboard just in time for the call. You need to paste the clipboard content into the Launch Center Pro's dial search box to find the appropriate contact before making the call.…
due://x-callback-url/add?
title=Call%20[[title]]%20at%20[[body]]%0A
{{drafts://x-callback-url/create?
text=[[title]]&
action=Copy%20to%20Clipboard&
x-success=launchpro-dial%3A&
afterSuccess=Delete}}&
x-source=Drafts&
x-success={{drafts://}}
@epramono
epramono / AddRemindersToDue
Last active December 20, 2015 15:29
This action allows you to convert each line in your current Drafts post into separate reminders in Due. Requires: Drafts 3.5.4 and Due 1.8.
due://x-callback-url/add?
title=[[title]]&
x-source=Drafts&
x-cancel=
{{drafts://x-callback-url/create?
text=[[body]]&
action=Add%20Reminders%20to%20Due&
allowEmpty=NO&
afterSuccess=Delete}}
&x-success=
@epramono
epramono / EncodeURLToClipboard
Created August 5, 2013 08:39
When you're composing your own custom URL actions in Drafts, you often find yourself in need of a simple URL encoding service to encode parts of your action. If you have Launch Center Pro installed, you can use this action to encode the current content of your post and store the encoded version in the clipboard. Requires: Drafts 2.5 and Launch C…
drafts://x-callback-url/create?
text=[[draft]]&
action={{Copy to Clipboard}}&
x-success=
{{launchpro-clipboard://x-callback-url/convert?
format=urlencode&
x-success=drafts%3A%2F%2F}}
@epramono
epramono / CreateURLAction
Created August 5, 2013 08:30
If you want to compose your own custom URL actions in Drafts, you're going to need this action. This is one of my most frequently used actions. It will create a new URL action in Drafts whose name equals to `[[title]]` and the URL equals to `[[body]]` of the current post. Requires: Drafts 2.5
drafts://x-callback-url/import_action?
type=URL&
name=[[title]]&
url=[[body]]
@epramono
epramono / MailLaterWithBody
Last active December 20, 2015 14:39
This action will prepare an email draft containing the recipient, subject and body, based on your Drafts post; and store it as a reminder in Due. The first line of your post will be treated as the email recipient, the second line as the email subject, and the third line as the date/time when you want to be reminded. The fourth line up to the end…
due://x-callback-url/add?
title=Mail%20about%20[[line|2]]%20at%20[[line|3]]%0A
{{launchpro-email://x-callback-url/?
to=[[line|1]]&
subject=[[line|2]]&
body=[[line|4..]]&
x-success=due%3A%2F%2F}}&
x-source=Drafts&
x-success={{drafts://}}
@davebang
davebang / Space Invaders.py
Created July 30, 2013 14:11
Space Invaders
# Space Invaders clone
# by davebang
from scene import *
from time import sleep
from console import *
import sound
from random import randint
screen_size = Size()