This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run taskName | |
tell application "iCal" | |
tell calendar "WhateverYourReminderListIsCalled" | |
make new todo at end with properties {summary:taskName} | |
end tell | |
end tell | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import webbrowser as wb | |
import simplejson as json | |
from restkit import Resource, BasicAuth, request | |
def createTask(server_base_url, user, password, project, task_summary): | |
auth = BasicAuth(user, password) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Smart little helper to find main thread hangs. Enable in appDidFinishLaunching. | |
// Only available with source code in DEBUG mode. | |
@interface PSPDFHangDetector : NSObject | |
+ (void)startHangDetector; | |
@end | |
@implementation PSPDFHangDetector | |
+ (void)startHangDetector { | |
#ifdef DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pebble_os.h" | |
#include "pebble_app.h" | |
#include "pebble_fonts.h" | |
#define MY_UUID { 0x57, 0xFF, 0x75, 0x31, 0x72, 0x97, 0x46, 0x0A, 0x86, 0x02, 0x6F, 0x6F, 0x79, 0xEA, 0x4E, 0xE4 } | |
PBL_APP_INFO(MY_UUID, | |
"Watchface", "Javier Soto", | |
1, 0, /* App version */ | |
DEFAULT_MENU_ICON, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @discussion takes the passed image parameter and displays a view controller modally that shwos the image | |
* You can call it from the debugger like this: | |
* expr JSDebugDisplayImage(image) | |
* @note you can dismiss the view controller simply by tapping on it | |
*/ | |
extern void JSDebugDisplayImage(UIImage *image); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSString (JSRemoveIrrelevantTags) | |
- (NSString *)js_stringByRemovingIrrelevantTags | |
{ | |
NSMutableString *filteredString = [NSMutableString string]; | |
NSSet *filteredLinguisticTags = [NSSet setWithArray:@[NSLinguisticTagDeterminer, NSLinguisticTagPreposition]]; | |
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length) | |
scheme:NSLinguisticTagSchemeLexicalClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MSDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead."))) | |
// Sample usage: | |
- (instancetype)initWithObject:(id)object; | |
- (instancetype)init MSDesignatedInitializer(initWithObject:); // <- This even gets auto-complete. | |
// Now calling init on this class would throw a warning. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ms_invoke_block_if_not_nil(BLOCK, ...) do { typeof((BLOCK)) b = (BLOCK); if (b) b(__VA_ARGS__); } while(0) | |
// Usage: | |
void (^block)(id, id, id) = void(^)(id parameter1, id parameter2, id parameter3) { | |
// ... | |
}; | |
ms_invoke_block_if_not_nil(block, parameter1, parameter2, parameter3); | |
// As opposed to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// JSDynamicRowHeightTableViewController.h | |
// | |
// Created by Javier Soto on 7/25/13. | |
// Copyright (c) 2013 JavierSoto. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Break on -[CALayer setBounds:] | |
// Condition: | |
((CGRect)*(CGRect *)($esp+12)).size.width > 10000 |
OlderNewer