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 <CoreData/CoreData.h> | |
#import "FindableData.h" | |
@interface Category : FindableData | |
{ | |
} | |
@property (nonatomic, retain) NSString *name; | |
@property (nonatomic, retain) NSSet *auctions; | |
@property (nonatomic, retain) NSNumber *auctionCount; |
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 AuctionTableDatasource | |
attr_writer :app_delegate | |
attr_accessor :view | |
. | |
. | |
. | |
def set_selected_category(category_name) | |
context = @app_delegate.managedObjectContext | |
@current_category = Category.find_first(context, by_name:category_name) |
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 TableViewDataSource | |
def awakeFromNib | |
view.registerForDraggedTypes( | |
NSArray.arrayWithObjects("BookmarkDictionaryListPboardType", "MozURLType", | |
NSFilenamesPboardType, NSURLPboardType, NSStringPboardType, nil)) | |
end | |
def tableView(aView, validateDrop:info, proposedRow:row, proposedDropOperation:op) | |
NSDragOperationEvery | |
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
# This example is flawed, but hopefully useful for demonstration purposes. | |
def test_stable_sorting | |
ary = (1..100).to_a.shuffle + (1..100).to_a.shuffle | |
# This associates an ordering with the randomized numbers | |
idx = 0 | |
paired = ary.collect {|value| [value, idx += 1]} | |
puts "Now the numbers are paired; the first is the random number 1-100," | |
puts "the second is its sequence within the 200 entries." | |
puts paired.inspect |
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
require "java" | |
java_import javax.swing.JOptionPane | |
class Whazzup | |
def initialize(file = "#{ENV['HOME']}/snippets.txt") | |
@snippets ||= open(file, 'ab') | |
log('[Starting up (ruby)]') | |
thread_loop = Thread.current |
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
$$('.switch').each(function(elem) { | |
real_element = elem.id.replace("-switch", ""); | |
if(!$(real_element).visible()) { | |
table = elem.parentNode.parentNode.parentNode.parentNode; | |
table.hide(); | |
if(table.previousElementSibling != null) { | |
if(table.previousElementSibling.tagName == 'BR') { | |
table.previousElementSibling.hide(); | |
} | |
} |
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
begin-base64 644 auto_shoulda.tar.bz2 | |
QlpoOTFBWSZTWfMxtz8ABAZ/lPyQACBy5/+/eiGeCv/v//QACIABAAhQBR7qp0dBylAUFAylAGmg | |
BoaAABoA0YmR6gAARFNp6UyZGgBo00BoZNGQA0ADTIaCRCCEpqe01I0P1T1NqeoaDQNqGI9IPU9R | |
6gNqHDTTIxGE0wEMAmmEYJiZDTI0NAFSSENMpo00NNTaJNMmIaA0AAYmTRppo9Ej0/YnSdhvk0e+ | |
q/GRa0rFA7KSJx0d/u798WggWrGrJEArqr4qLRwh0/HdwtMiQxe0UFSEqQtIshUj8BOyO17Kiqr+ | |
/L1bxloIg7QPCIYgdn6mhnXBsLXGskaRjMPk1RcupnL5GxJI9cioE0CR6sRpRaz07fkhNpjLf69U | |
jAUGsHL2cJXReb6hs/rVfYDbomNFhfx04Ji3lrfycAGYpSLygdwMQw/fXckIEImFCcAoFGYsqfUI | |
RlOiRCE9IEgVZmqGTGya0yjUMBQ4hoIPcSfU2M14tczczVRk128eKaP2f2s53AzeuQGaYgOEvTlb | |
8EQ3Y3uTtg4yX+GHo9tNyttpl24QNxB7sFcn4u0vY8M5VZzi9SRJI0MB7I5MBvgEABoNOZ3K3FKU | |
5SABpJCDEQANQZQGYMkkqt7MLCRY3pDl1mJY2EzJLz15IuY0vP4JDzpXXMk4xVXebJFMvdRpUpYS |
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
# This is a gross hack to make it possible to access the same | |
# resource from the context of different users at the same time. | |
# I'm quite positive this is wasteful and bad, but it's the only | |
# way to 'de-global' subclasses of ActiveResource::Base. :( It's | |
# also possible it leaks memory if the GC doesn't collect Class | |
# objects. -- Morgan Schweers, 09-Nov-2009 | |
class ResourceFactory | |
def self.get(klass) | |
Class.new(klass) do |resource| |
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
>> module Foo | |
>> def bar | |
>> puts @quux | |
>> end | |
>> end | |
=> nil | |
>> class Baz | |
>> attr_accessor :quux | |
>> def xyzzy |