Skip to content

Instantly share code, notes, and snippets.

agiletortoise / gist:9231841
Created February 26, 2014 15:39
Gcode - Start code
M92 X86.0 ; calibrate x
M92 Y86.0 ; calibrate y
M92 Z2015.75 ; calibrate z
M92 E102 ; calibrate E
// to share NSUserDefaults, init in App and Extension like...
[[NSUserDefaults alloc] initWithSuiteName:@""];
// to share with Files, read-write via files/folders in...
NSFileManager *fm = [NSFileManager defaultManager];
NSURL *containerURL = [fm containerURLForSecurityApplicationGroupIdentifier:@""];
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.

// 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 / gist:f19543567ed61ac28744
Last active August 29, 2015 14:07
Drafts 4 migration error notes


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

Drafts 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


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.

// 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.
let dirPath = NSFileManager.defaultManager().URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask).last?.path
agiletortoise / gist:1346212
Created November 7, 2011 21:16
traceroute to (, 64 hops max, 52 byte packets
1 ( 1.063 ms 0.728 ms 0.628 ms
2 ( 6.629 ms 7.189 ms 5.993 ms
3 ( 8.021 ms 11.710 ms 11.635 ms
4 ( 12.672 ms 9.899 ms 11.711 ms
5 ( 10.864 ms 10.276 ms 10.117 ms
6 ( 10.552 ms 12.966 ms 13.010 ms
7 ( 50.566 ms 50.114 ms 51.784 ms
8 ( 50.429 ms 51.446 ms 52.174 ms
9 ( 51.667 ms 51.268 ms 54.044 ms
agiletortoise /
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.