Skip to content

Instantly share code, notes, and snippets.

Avatar

Francisco Ryan Tolmasky I tolmasky

View GitHub Profile
View gist:37659
<?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>
View gist:37660
<?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>
View gist:56841
<script>
window.setTimeout(function() { alert(); window.setTimeout(alert(), 100); }, 100);
window.setTimeout(function() { alert(); window.setTimeout(alert(), 100); }, 100);
alert();
</script>
View gist:82369
@implementation Shape : CPObject
{
CGRect mRect;
CPColor mColor;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeRect:mRect forKey:"rect"];
[aCoder encodeObject:mColor forKey:"color"];
View gist:86179
#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'rubygems'
require 'sinatra'
set :app_file, __FILE__
require 'socratic'
View gist:117444
@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";
View gist:118243
+ (void)initialize
{
if (self == MyClass)
return;
unsigned int count;
objc_property_t * properties = class_copyPropertyList(self, &count);
while (count--)
{
View gist:124533
//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];
View gist:174983
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}
View gist:174982
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}