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
#!/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
- (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
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
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
#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
#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
#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
#import <AppKit/AppKit.h> | |
NSRunningApplication* frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication]; | |
pid_t pid = [frontApp processIdentifier]; | |
// fprintf(stdout, "%s\n", [[NSString stringWithFormat:@"%ld", (long)pid] 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
# Visualise given word embeddings | |
# words is a list of words | |
# data is the vector representation of each word | |
# Train the algorithm | |
from sklearn.manifold import TSNE | |
vis_algo = TSNE(random_state=0, verbose=10, init='pca', n_iter=200) | |
vis = vis_algo.fit_transform(data) | |
# Plot the resulting visualisation |