Skip to content

Instantly share code, notes, and snippets.

@philgruneich
philgruneich / Add to Clear later
Created July 9, 2013 04:16
Create a Due reminder (list name in the first line, task name in the second, date/time specification for Due in the third) with a link to add the task to Clear only when you need the task in your to-do list.
due://x-callback-url/add?title=[[line|2]]%20at%20[[line|3]]%0A{{clearapp://task/create?listName=[[line|1]]&taskName=[[line|2]]}}&x-source=Drafts&x-success={{drafts://}}
@philgruneich
philgruneich / Add to Ita later
Created July 9, 2013 04:17
Create a Due reminder (list name in the first line, task name in the second, date/time specification for Due in the third) with a link to add the task to Ita only when you need the task in your to-do list.
due://x-callback-url/add?title=[[line|2]]%20at%20[[line|3]]%0A{{ita://addItem?list=[[line|1]]&items=[[line|2]]}}&x-source=Drafts&x-success={{drafts://}}
@philgruneich
philgruneich / Send short markdown email
Created July 31, 2013 00:59
one-tap send clipboard message in markdown as an HTML email using Drafts and Launch Center Pro. This action takes the first line as recipients, second line as subject and moves your content around using the clipboard. It only works for short emails that use no more than a single paragraph.
//Create the following rule at Launch Center Pro:
drafts://x-callback-url/create?text={{[[clipboard]]}}&action=Markdown%20Short
//Add the following rule to Drafts, named Markdown Short:
drafts://x-callback-url/create?text=[[line|3]]&action=Markdown%3A%20Copy%20to%20Clipboard&x-source=Drafts&x-success={{drafts://x-callback-url/create?text=[[line|1]]%0A[[line|2]]&action=Short%20Clipboard%20Mail&afterSuccess=Delete}}&afterSuccess=Delete
//Add this other rule to Drafts, named Short Clipboard Mail:
@philgruneich
philgruneich / Send long markdown email
Created July 31, 2013 01:02
one-tap send clipboard message in markdown as an HTML email using Drafts and Launch Center Pro. This action takes the first line as recipients and the remaining as the content. This action works for emails with more than a single paragraph.
//Create the following rule at Launch Center Pro:
drafts://x-callback-url/create?text={{[[clipboard]]}}&action=Markdown%20Long
//Add the following rule to Drafts, named Markdown Long:
drafts://x-callback-url/create?text=[[body]]&action=Markdown%3A%20Copy%20to%20Clipboard&x-source=Drafts&x-success={{drafts://x-callback-url/create?text=[[title]]&action=Long%20Clipboard%20Mail&afterSuccess=Delete}}&afterSuccess=Delete
//Add this other rule to Drafts, named Long Clipboard Mail:
@philgruneich
philgruneich / ios_icons.py
Last active January 14, 2016 00:26 — forked from sgerin/ios_icons
Updated with iOS 7 masks (:
# 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.
# iOS 7 masks by @pgruneich on Twitter.
from PIL import Image
from StringIO import StringIO
import re
import requests
from webbrowser import open
from urllib import quote
query = sys.argv[1]
#Web Services
stackoverflow = '!s '
wikipedia = '!w '
macupdate = '!mac '
appshopper = '!app '
@philgruneich
philgruneich / kirby_video.php
Last active February 26, 2024 07:00
This extension includes the HTML5 video tag as kirbytext and has several optional parameters. It accepts input of .ogg, .webm and custom fallback. If you don't choose width and height, it picks the one in the config.php file. It also supports class and title.
<?php
class kirbytextExtended extends kirbytext {
function __construct($text, $markdown=true) {
parent::__construct($text, $markdown);
$this->addTags('video');
@philgruneich
philgruneich / UpdatePinboardTags.py
Last active July 14, 2020 16:13
UpdatePinboardTags
#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else:
# -*- coding: utf-8 -*-
from json import loads
from requests import get
import location
from datetime import date
import time
from console import alert
# Customization here
APItoken = 'Insert your API token here'
@philgruneich
philgruneich / commas_mmdtable.py
Last active March 18, 2018 13:17
Scripts to simplify the syntax for MultiMarkdown tables.
import re
table = '''First Header,Second Header,Third Header
1st Item,2nd\,Item,3rd Item
,One cell,Two cells
Two cells,One cell,
Awesome'''
ttable = [[re.sub('\\\,',',',cell) for cell in re.split('(?<!\\\),', row)] for row in table.split('\n')]