Skip to content

Instantly share code, notes, and snippets.

View tolmasky's full-sized avatar

Francisco Ryan Tolmasky I tolmasky

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Name</key>
<string>YouKit</string>
<key>Targets</key>
<array>
<dict>
<key>Name</key>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CPBundleIdentifier</key>
<string>com.You.YouKit</string>
<key>CPBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CPBundleName</key>
<string>YouKit</string>
<script>
window.setTimeout(function() { alert(); window.setTimeout(alert(), 100); }, 100);
window.setTimeout(function() { alert(); window.setTimeout(alert(), 100); }, 100);
alert();
</script>
@implementation Shape : CPObject
{
CGRect mRect;
CPColor mColor;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeRect:mRect forKey:"rect"];
[aCoder encodeObject:mColor forKey:"color"];
#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'rubygems'
require 'sinatra'
set :app_file, __FILE__
require 'socratic'
@implementation OpenPanel (WebScripting)
+ (NSString *)webScriptNameForSelector:(SEL)aSelector
{NSLog(@"asdf");
if (aSelector == @selector(beginForDirectory:file:types:callback:))
return @"begin";
if (aSelector == @selector(runModalForDirectory:file:types:))
return @"runModal";
+ (void)initialize
{
if (self == MyClass)
return;
unsigned int count;
objc_property_t * properties = class_copyPropertyList(self, &count);
while (count--)
{
//this is the view i use to show the selection:
_toolbarSelection = [[CPImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 57.0)];
[_toolbarSelection setImage:MediaWindowControllerToolbarSelectionImage];
[_toolbarSelection setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin];
// Here comes the hack:
[myWindow._toolbarView addSubview:_toolbarSelection];
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}