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
(* | |
Brett Kelly wrote this. | |
http://nerdgap.com | |
*) | |
tell application "Address Book" | |
-- init our lists of stuff | |
set peeps to every person | |
set bdays to {} | |
set bdaynames 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
select uniqueids from downloadkeys | |
where timestamp in | |
(select timestamp from downloadkeys order by timestamp desc limit 10) | |
order by timestamp desc |
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
(* based almost entirely on Justin Lancy's script: | |
http://veritrope.com/code/evernote-get-plain-text-of-selected-note/ | |
*) | |
tell application "Evernote" | |
set theSelection to selection | |
set theHTML to HTML content of (item 1 of theSelection) | |
set plainText to ¬ | |
do shell script "echo " & quoted form of theHTML & space & "| textutil -convert txt -stdin -stdout" | |
set myWords to count of words in plainText | |
display dialog "Words: " & myWords with title "Word Count" |
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
tell application "Finder" | |
try | |
set appPath to (path to application "Evernote" as text) | |
on error | |
display dialog "Couldn't find Evernote. Is it installed?" | |
end try | |
set printPath to (path to "dlib" from user domain as text) & "PDF Services" | |
make new alias at printPath to appPath with properties {name:"Send PDF to Evernote"} | |
end tell |
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
def imageExists(url): | |
"""Checks to see if an image URL is actually real and returns a real image""" | |
goodMimes = ['image/png','image/jpg','image/jpeg','image/gif'] | |
try: | |
h = httplib2.Http() | |
r,c = h.request(url,'GET') | |
return r['content-type'] in goodMimes | |
except: | |
return False |
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
$(function(){ | |
$('input[placeholder]').each( | |
function(){ | |
var val = $(this).attr('placeholder'); | |
$(this).attr('value',val); | |
} | |
); | |
}); |
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 <UIKit/UIKit.h> | |
@interface ECViewController : UIViewController | |
@property (strong, nonatomic) IBOutlet UILabel *usernameField; | |
@property (strong, nonatomic) IBOutlet UILabel *noteCountField; | |
@property (strong, nonatomic) IBOutlet UIButton *noteCountButton; | |
- (IBAction)retrieveUserNameAndNoteCount:(id)sender; |
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 "ECViewController.h" | |
@interface ECViewController () | |
@end | |
@implementation ECViewController | |
- (void)viewDidLoad | |
{ |
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
- (int)countAllNotesAndSetTextField:(EvernoteSession *)session | |
{ | |
EvernoteNoteStore *noteStore = [EvernoteNoteStore noteStore]; | |
[noteStore listNotebooksWithSuccess:^(NSArray *notebooks) { | |
__block int noteCount = 14; | |
for (EDAMNotebook *notebook in notebooks) { | |
if ([notebook guid]) { |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; | |
// Override point for customization after application launch. | |
self.viewController = [[[ECViewController alloc] initWithNibName:@"ECViewController" bundle:nil] autorelease]; | |
self.window.rootViewController = self.viewController; | |
[self.window makeKeyAndVisible]; | |
return YES; | |
} |