Skip to content

Instantly share code, notes, and snippets.

View hammerdr's full-sized avatar

Derek Hammer hammerdr

View GitHub Profile
@import <AppKit/CPView.j>
@implementation OLResourceView : CPView
{
}
- (id)initWithFrame:(CGRect)frame
{
if(self = [super initWithFrame:frame])
{
@implementation CPArray (Find)
- (CPObject)findBy:(Function)isTheObject
{
for(int i = 0; i < [self count]; i++)
{
if(isTheObject([self objectAtIndex:i]))
{
return [self objectAtIndex:i];
}
@implementation OJUser : CPObject
...
- (void)initWithConnection:(OJConnection)connection
...
- (void)save
{
[connection save:self];
}
@hammerdr
hammerdr / gist:230517
Created November 10, 2009 01:11
.autotest file for testing Objective-J
class Autotest
def make_test_cmd files_to_test
return "objj RunTests.j"
end
end
class Autotest
def make_test_cmd files_to_test
return "objj RunTests.j"
end
end
class OJMoq
{
OJMoqSelector Selector(SEL aSelector)
{
var theSelector = new OJMoqSelector(aSelector);
selectors.Add(theSelector);
return theSelector;
}
- (void)didSubmitRegistration:(CPDictionary)registrationInfo
{
}
@import <AppKit/CPWindow.j>
@import "../models/OLFeedback.j"
@implementation OLFeedbackWindow : CPWindow
{
CPView _feedbackView;
CPView _submittingFeedbackView;
CPView _submittedFeedbackView;
CPView _currentView; // Keeps track of the current content view
@import <AppKit/CPTableView.j>
@implementation CPTableView (DoubleClick)
- (void)mouseDown:(CPEvent)anEvent
{
if ([anEvent clickCount] == 2)
{
var index = [[self selectedRowIndexes] firstIndex];
...
- (void)loadEverything
{
loginController = [[LoginWindowController alloc] init...];
[loginController setDelegate:self];
}
- (void)someFunction
{