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
# from http://www.davidchinphoto.com/snow-leopard-and-adobe-unit-types-osax/ via @kamitchell : | |
sudo rm -rf /Library/ScriptingAdditions/Adobe\ Unit\ Types.osax | |
sudo ln -s /dev/null /Library/ScriptingAdditions/Adobe\ Unit\ Types.osax |
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
calendarsTableView = [[CPTableView alloc] initWithFrame:tableFrame]; | |
[calendarsTableView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; | |
[[nameColumn headerView] setStringValue:'Name____']; | |
[[nameColumn headerView] sizeToFit]; | |
[nameColumn setWidth:[[nameColumn headerView] frame].size.width]; | |
[calendarsTableView addTableColumn:nameColumn]; |
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)windowDidLoad { | |
var window = [self window], | |
contentView = [window contentView], | |
contextViewSize = [contentView bounds].size, | |
scrollSize = CGSizeMake(contextViewSize.width - (20*2), contextViewSize.height - 70), | |
scrollFrame = CGRectMake(20, 20, scrollSize.width, scrollSize.height), | |
tableFrame = CGRectMake(0, 0, scrollSize.width, scrollSize.height), | |
tableView = [[CPTableView alloc] initWithFrame:tableFrame], | |
nameColumn = [[CPTableColumn alloc] initWithIdentifier:'name'], | |
yearColumn = [[CPTableColumn alloc] initWithIdentifier:'year'], |
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
// Store Twitter Replies in Yojimbo.jstalk | |
// | |
// Usage: select a subscription in NetNewsWire that contains a bunch of twitter replies you'd like to archive | |
// (often lazytweet replies). This script will gather all *unread* "headlines" (sadly I can't seem to just | |
// access selected headlines) and push them into one new Yojimbo note (all hyperlinked and stuff). | |
var nnw = [SBApplication application:"NetNewsWire"], | |
headlines = [[nnw selectedSubscription] headlines], | |
headlineIndex = 0, | |
headlineCount = [headlines 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
NSAppleEventDescriptor *target = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplicationBundleID | |
data:[@"com.apple.Finder" dataUsingEncoding:NSUTF8StringEncoding]]; | |
NSAppleEventDescriptor *quitEvent = [NSAppleEventDescriptor appleEventWithEventClass:kCoreEventClass | |
eventID:kAEQuitApplication | |
targetDescriptor:target | |
returnID:kAutoGenerateReturnID | |
transactionID:kAnyTransactionID]; | |
OSStatus err = AESendMessage([quitEvent aeDesc], // theAppleEvent | |
NULL, // reply | |
kAENoReply, // sendMode |
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
RewriteEngine On | |
#RewriteLogLevel 2 | |
#RewriteLog /var/log/apache2/rewrite.log | |
#RewriteCond %{REQUEST_METHOD} ^TRACE | |
RewriteCond %{QUERY_STRING} ^(.+)$ | |
RewriteRule ^(.*)$ /displayPage.php?path=$1&%1 [L,PT] | |
RewriteRule ^(.*)$ /displayPage.php?path=$1 [L,PT] |
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/local/bin/macirb --simple-prompt | |
>> d1 = NSMutableDictionary.dictionary | |
=> {} | |
>> d2 = {} | |
=> {} | |
>> d1.class.ancestors | |
=> [NSMutableDictionary, NSDictionary, Enumerable, NSObject, Kernel] | |
>> d2.class.ancestors | |
=> [NSMutableDictionary, NSDictionary, Enumerable, NSObject, Kernel] |
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
wolf-mbp:~ wolf$ macirb | |
irb(main):001:0> a = ['a','b'] | |
=> ["a", "b"] | |
irb(main):002:0> a.each {|x| puts x} | |
a | |
b | |
=> ["a", "b"] | |
irb(main):003:0> s = NSSet.setWithArray(a) | |
=> #<NSCFSet:0x20024e260> | |
irb(main):004:0> s.each {|x| puts x} |
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
var bustedInput = document.getElementsByTagName('zinput')[0]; | |
var fixedInput = document.createElement('input'); | |
for (var attrIndex = 0; attrIndex < bustedInput.attributes.length; attrIndex++) { | |
var attrName = bustedInput.attributes[attrIndex].nodeName; | |
var attrValue = bustedInput.getAttribute(attrName); | |
fixedInput.setAttribute(attrName, attrValue); | |
} | |
bustedInput.parentElement.appendChild(fixedInput); | |
bustedInput.parentElement.removeChild(bustedInput); |
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
syntax: glob | |
\.DS_Store | |
Icon? | |
*~.nib | |
build | |
\.metadata | |
bin | |
*.pbxuser | |
*.mode1v3 | |
dist |