Skip to content

Instantly share code, notes, and snippets.

@agiletortoise
agiletortoise / grammar-markdown.json
Created February 17, 2019 21:09
Drafts Markdown Def File
{
"name": "Markdown",
"description": "Basic Markdown syntax based more closely on the original Markdown specification.",
"scopeName": "text.markdown",
"rangeExtension": "lineExtended",
"listCompletion": "markdown",
"fileExtensions": [
"markdown",
"mkdown",
"md",
@agiletortoise
agiletortoise / drafts-5-4-notes.md
Created September 11, 2018 19:18
Drafts 5.4 Release Notes Draft

Drafts 5.4 Release Notes Draft

Siri & Shortcuts Support

  • "Run Shortcut" action step. Pass text to the Shortcuts app and trigger a Shortcut by name with a single tap. This is the same functionality available in the "Run Workflow" action step, updated for the new Shortcuts app.
  • Siri Intents:
    • "Capture clipboard" Siri shortcut. This shortcut allows capture of the current clipboard content to a new draft in Drafts without launching the app.
    • "View draft" Siri Shortcut. Allows creation of a shortcut which displays the content of a specific draft in the Siri interface - with the ability to tap and open that draft in the app. Great for previewing lists, or regularly view reference notes.
  • "Add to Siri" buttons to create voice shortcuts to functions in Drafts directly in the app in the following locations (iOS 12 only):
    • Add shortcut to open a specific draft in the (i) detail view.
@agiletortoise
agiletortoise / gist:1346212
Created November 7, 2011 21:16
traceroutes
traceroute to charter.com (68.170.21.50), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 1.063 ms 0.728 ms 0.628 ms
2 10.108.128.1 (10.108.128.1) 6.629 ms 7.189 ms 5.993 ms
3 crr01ftwotx-tge-0-3-0-5.ftwo.tx.charter.com (96.34.113.112) 8.021 ms 11.710 ms 11.635 ms
4 bbr01ftwotx-tge-0-0-5-0.ftwo.tx.charter.com (96.34.2.32) 12.672 ms 9.899 ms 11.711 ms
5 dls-bb1-link.telia.net (80.239.160.197) 10.864 ms 10.276 ms 10.117 ms
6 192.205.37.49 (192.205.37.49) 10.552 ms 12.966 ms 13.010 ms
7 cr1.dlstx.ip.att.net (12.122.214.246) 50.566 ms 50.114 ms 51.784 ms
8 cr2.nsvtn.ip.att.net (12.122.1.242) 50.429 ms 51.446 ms 52.174 ms
9 cr1.cl2oh.ip.att.net (12.122.28.74) 51.667 ms 51.268 ms 54.044 ms
// add "-DDEBUG" to Build Settings > Swift Compiler flags > Other Swift Flags
// stick this code in didFinishLaunchingWithOptions
// then you can easily locate the iOS Sim's app documents directory to check on files.
#if DEBUG
let dirPath = NSFileManager.defaultManager().URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask).last?.path
print(dirPath)
#endif

Description

Some users have been reporting a "hang" when using Drafts on their devices. Symptoms seem to vary between users who are seeing this issue, but descriptions suggest it is a multi-second hang where the app become unresponsive to touch. Most report suggest the hang stops and the app resumes without crashing after some varying amount of time – usually several seconds.

Some users have reported this occurring on launch of the app, some at random times when using the app. I have not been able to reproduce this issue on any of my test devices, so it has been very difficult to determine a possible cause. If you are seeing this issue, I would like to ask your help in determining what is going on to resolve it.

How to help

If you have a repeatable hang in Drafts, I would like to ask you to capture "stackshots" from your device at the time the hang is happening. This will allow me to better see what is going on at the time of the hang, both in Drafts and elsewhere in your system.

Drafts 4.0.3.05 changelog

As of 10/23/2014, this build has been submitted to Apple for review, but is not yet available in the App Store. This list is provided only for those interested in the fixes coming. For more information, visit our website or follow @draftsapp on Twitter.

  • [MIGRATION FIX] If you received an "Import Failed" error migrating drafts from Drafts 3, please try again with this update. Issue is resolved for all sample data sets I've been able to test.
  • [Fix] Workaround for hang on launch on iOS 8.1 related to iCloud system hang.
  • [Fix] Significant sync improvements across the board.
  • [New] Sync debug logging and ability to email logs to support. If you continue to see sync issues, please contact us – we have now built in a logging facility to better troubleshoot specific sync cases.
  • [New] Redesign of Today widget.
  • [Fix] Deleting an action did not trigger a save of actions as it should, causing deleted actions to reappear if no other action changes we
@agiletortoise
agiletortoise / gist:f19543567ed61ac28744
Last active August 29, 2015 14:07
Drafts 4 migration error notes

UPDATE

The migration issue has been found and will be fixed in Drafts 4.0.2, which will likely be submitted to Apple on 10/16.

Migration Issue

Some users are reporting an "Import Failed" error trying to migrate drafts to Drafts 4.

It appears some users have some history in their drafts that was not encountered in the beta cycle and is causing an issue with the import. If you would be willing to share your export file for testing, please follow the migration instructions, but select "Email" as the destination instead of "Open in" and send it to info@agiletortoise.com.

// Drafts 4 script step to create custom tags
// using the a line or a default value if that line is empty or missing
// split draft into an array of lines
var lines = draft.content.split('\n');
// reusable function to define tag based on line or default string
function createLineTag(lineNumber,default) {
var tagName = "line"+(lineNumber+1).toString();
if(lines[lineNumber] && lines[lineNumber].length > 0) {
@agiletortoise
agiletortoise / gist:044d3f20b3f1a94aa2f7
Last active August 29, 2015 14:06
What's New in Drafts 4 (Quick Draft)

A better list of what's new is now here.

// to share NSUserDefaults, init in App and Extension like...
[[NSUserDefaults alloc] initWithSuiteName:@"group.com.xxx.xxx"];
// to share with Files, read-write via files/folders in...
NSFileManager *fm = [NSFileManager defaultManager];
NSURL *containerURL = [fm containerURLForSecurityApplicationGroupIdentifier:@"group.com.xxx.xxx"];