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
[[NSBundle bundleWithPath:'/Library/Frameworks/JSON.framework'] load]; |
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 "Address Book" | |
set s to selection | |
set d to (creation date of item 1 of s) as text | |
set n to name of item 1 of s | |
display dialog d with title "Creation Date for " & n | |
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
#!/usr/bin/macruby | |
# Need the AddressBook framework | |
framework 'AddressBook' | |
# Singleton | |
ab = ABAddressBook.sharedAddressBook | |
# me is the ABRecord of the current logged in user | |
# valueForProperty() is the KVO method to get the constant |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'rubygems' | |
require 'json' | |
options = {} | |
data = {} | |
optparse = OptionParser.new do |opts| |
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
NSRect mainDisplayRect = [[NSScreen mainScreen] frame]; | |
NSWindow *fullScreenWindow = [[NSWindow alloc] initWithContentRect:mainDisplayRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; | |
[fullScreenWindow setLevel:NSMainMenuWindowLevel+1]; | |
[fullScreenWindow makeKeyAndOrderFront:self]; |
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 "MainWindow.h" | |
// MainWindow subclasses NSWindow | |
@implementation MainWindow | |
@synthesize webView, isHTMLInputElement; | |
// We intercept the sendEvent: method at the NSWindow level to inspect it. | |
// If the event type is a click ("NSLeftMouseDown") and the element that the mouse | |
// is hovering over is an input, then we do something |
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
tf = CAMediaTimingFunction.alloc | |
tf.send "initWithControlPoints::::".to_sym 0.5, 1.0, 0.5, 0.0 |
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
class Object | |
def descendants | |
descendants = [] | |
descendants << self.superclass | |
descendants.each do |klass| | |
descendants << klass.superclass if klass != BasicObject | |
end | |
end | |
end |
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
:storage => "S3", | |
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml", | |
:path => ":attachment/:id/:style/:basename.:extension", | |
:bucket => 'yourbucketname' |
OlderNewer