Skip to content

Instantly share code, notes, and snippets.

View epramono's full-sized avatar

Eric Pramono epramono

View GitHub Profile
@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 / AppGoneFree
Last active December 20, 2015 14:39
This action allows you to set a reminder in Due to search for an app that has just gone free. This is very useful if you're trying to download an app larger than 50 MB while you're on a 3G connection. As a bonus, you can share the news with your friends via Tweetbot. Requires: Drafts 3.0.6, Due 1.8, and Tweetbot 1.3.
due://x-callback-url/add?
title=Search%20for%20[[line|1]]%20at%20[[line|2]]%0A
{{http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?
media=software&
term=[[line|1]]}}&
x-source=Tweetbot&
x-success=
{{tweetbot://epramono/post?
text=[[line|3]]%20[[line|1]]%20is%20free%20today.%0A%0A
http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZSearch.woa%2Fwa%2Fsearch%3Fmedia%3Dsoftware%26term%3D[[line|1]]&
@epramono
epramono / AppendURLTitleQuoteToDrafts.js
Created August 4, 2013 00:07
This JavaScript bookmarklet will create a new post in Drafts containing the page title, URL and the current content of your clipboard.
javascript:window.location='drafts://x-callback-url/create?text='+
encodeURIComponent(document.title+'%5Cn')+
encodeURIComponent(location.href)+
'&action=Append%20with%20Clipboard&afterSuccess=Delete'
@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://}}
@epramono
epramono / TrackGasFillUp
Created August 3, 2013 14:41
A custom URL action in Drafts that creates a new entry in the default list of the Reminder app. The entry will be converted as a new row in a Google Spreadsheet file entitled "Gas Fill Up" using a specific IFTTT recipe. The Google Spreadsheet recipe uses ||| as the column separator.
drafts://x-callback-url/create?
text=Gas%20Fill%20Up%0A[[date|%-m/%-d/%y]]%7C%7C%7C[[date|%-I:%M:%S %p]]%7C%7C%7C[[line|1]]%7C%7C%7C[[line|2]]%7C%7C%7C[[line|3]]%7C%7C%7C[[line|4]]&
action=Reminder&
afterSuccess=Delete
@epramono
epramono / TrackExpensesInGoogleSpreadsheet
Created August 3, 2013 14:37
A custom URL action in Drafts that creates a new entry in the default list of the Reminder app. The entry will be converted as a new row in a Google Spreadsheet file entitled "Expenses" using a specific IFTTT recipe. The Google Spreadsheet recipe uses ||| as the column separator.
drafts://x-callback-url/create?
text=Expenses%0A[[date|%-m/%-d/%y]]%7C%7C%7C[[date|%-I:%M:%S %p]]%7C%7C%7C[[line|1]]%7C%7C%7C[[line|2]]%7C%7C%7C[[line|3]]&
action=Reminder&
afterSuccess=Delete
@epramono
epramono / TravelPackingListInClear
Created August 3, 2013 14:30
A custom URL action in Drafts that allows you to create a packing list in Clear based on a comma-separated list stored in TextExpander Touch under the snippet <<travel>>. The default list will be appended with a comma-separated list you write in the [[body]] of your Drafts post. The [[title]] is reserved for the list title.
clearapp://list/create?
listName=[[title]]&
tasks={{<<ttravel>>}}%20[[body]]
@epramono
epramono / TravelPackingListInSilo
Last active December 20, 2015 14:29
A custom URL action in Drafts that allows you to create a packing list in Silo based on a comma-separated list stored in TextExpander Touch under the snippet <<travel>>. The default list will be appended with a comma-separated list you write in the [[body]] of your Drafts post. The [[title]] is reserved for the list title.
silo://x-callback-url/list_entity/add?
title=[[title]]&
notes={{<<ttravel>>}}[[body]]&
x-success={{drafts://}}
@epramono
epramono / PrependLinkToByword.js
Last active December 20, 2015 13:39
Installing this bookmarklet in Safari's Bookmarks Bar on your iPad will allow you to append a document named "Unitlted.txt" which is stored in iCloud with a Markdown-style hyperlink containing the currently selected text and the page URL. Once the hyperlink has been added, you will be redirected back to Safari automatically. For more information…
javascript:window.location=
'byword%3A%2F%2Fx-callback-url%2Fappend%3Flocation%3Dicloud%26name%3DUntitled.txt%26text%3D'+
encodeURIComponent("\n["+window.getSelection()+"]")+
encodeURIComponent("("+location.href+")\n")+
'%26x-success%3D'+encodeURIComponent(location.href)