Skip to content

Instantly share code, notes, and snippets.

@davedelong
davedelong / gist:4114242
Created November 19, 2012 21:48
Removing unused tags from Evernote
//
// main.m
// Tag Cleaner
//
// Created by Dave DeLong on 11/17/12.
// Copyright (c) 2012 Dave DeLong. All rights reserved.
//
// requires https://github.com/evernote/evernote-sdk-mac
@davedelong
davedelong / gist:1236778
Created September 23, 2011 05:07
Snippet to discover the BOM of a text encoding
NSData *bom = nil;
NSStringEncoding encoding = ...;
NSData *a = [@"a" dataUsingEncoding:encoding];
NSData *aa = [@"aa" dataUsingEncoding:encoding];
if ([a length] * 2 != [aa length]) {
NSUInteger characterLength = [aa length] - [a length];
bom = [a subdataWithRange:NSMakeRange(0, [a length]-characterLength)];
}
@davedelong
davedelong / Copy DerivedData Folder
Created March 8, 2011 00:16
Copies the derived data directory for the current Xcode4 project or workspace.
(************************************************************************************
Copies the derived data directory for the current Xcode4 project or workspace to the clipboard
The copied path is in POSIX form suitable for pasting into a Terminal instance.
Created 03/04/2011 by Ben Dolman
This code is in the public domain
************************************************************************************)
set derivedDataDir to (path to current user folder as string) & "Library:Developer:Xcode:DerivedData:"
tell application "Xcode"