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/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' |
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 "Terminal" | |
set openWindows to every window | |
set openTabs to {} | |
repeat with i from 1 to number of items in openWindows | |
set this_item to item i of openWindows | |
set openTabs to openTabs & every tab of this_item | |
end repeat | |
repeat with i from 1 to number of items in openTabs | |
set this_item to item i of openTabs | |
do script "source ~/.zshrc" in this_item |
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/nush | |
(load "ScriptingBridge") ; Load the ScriptingBridge framework | |
(set finder (SBApplication applicationWithBundleIdentifier: "com.apple.Finder")) ; Reference to shared instance | |
(puts (((finder disks) 0) name)) ; Name of the first disk in the Finder |