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 <CoreFoundation/CoreFoundation.h> | |
AXUIElementRef app = AXUIElementCreateApplication(pid); |
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 <CoreFoundation/CoreFoundation.h> | |
AXError rtn = AXUIElementCopyAttributeValue(someApp, someAttribute, (CFTypeRef *)&someRef); | |
if (rtn == kAXErrorSuccess) { | |
printf("\nSuccess"); | |
} else if (rtn == kAXErrorInvalidUIElement){ | |
printf("\nInvalid UI Element"); | |
} else if (rtn == kAXErrorIllegalArgument) { | |
printf("\nIllegal argument"); | |
} else if (rtn == kAXErrorCannotComplete) { | |
printf("\nCannot complete"); |
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 <AppKit/AppKit.h> | |
#import <Foundation/Foundation.h> | |
#include <CoreFoundation/CoreFoundation.h> | |
NSRunningApplication* frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication]; | |
pid_t pid = [frontApp processIdentifier]; | |
AXUIElementRef app = AXUIElementCreateApplication(pid); | |
AXUIElementRef window; |
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
fprintf(stdout, "%s\n", [str UTF8String]); | |
fflush(stdout); |
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
const spawn = require('child_process').spawn; | |
const ls = spawn('ls', ['-lh', '/usr']); | |
ls.stdout.on('data', (data) => { | |
console.log(`stdout: ${data}`); | |
}); | |
ls.stderr.on('data', (data) => { | |
console.log(`stderr: ${data}`); | |
}); | |
ls.on('close', (code) => { |
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
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { CFMutableDictionaryRef options = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionarySetValue(options, kAXTrustedCheckOptionPrompt, kCFBooleanTrue); AXIsProcessTrustedWithOptions(options); CFRelease(options); } |
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
#!/bin/bash | |
# Name of your app. | |
APP="YourApp" | |
# The path of you app to sign. | |
APP_PATH="/path/to/YouApp.app" | |
# The path to the location you want to put the signed package. | |
RESULT_PATH="~/Desktop/$APP.pkg" | |
# The name of certificates you requested. | |
APP_KEY="3rd Party Mac Developer Application: Company Name (APPIDENTITY)" |
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 ... from ...) foo union (select ... from ...) bar; | |
(select ... from ...) foo intersect (select ... from ...) bar; | |
(select ... from ...) foo except (select ... from ...) bar; |
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
NSString *stringToCopy = @"Djyes"; | |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; | |
[pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; | |
BOOL success = [pasteboard setString:stringToCopy forType:NSStringPboardType]; |
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
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.6 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |