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 <Cocoa/Cocoa.h> | |
@interface Dog : NSObject { | |
NSString *name; | |
NSString *color; | |
NSString *hair; | |
NSString *size; | |
NSString *breed; | |
} | |
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 Dog | |
def initialize(options = {}) | |
@name = options[:name] | |
@color = options[:color] | |
@breed = options[:breed] | |
@hair = options[:hair] | |
@size = options[:size] | |
end | |
def description |
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 Core = (function($) { | |
return { | |
modules: {}, | |
addModule: function(module_name, fn) { | |
// create new sandbox for module | |
var sandbox = new Sandbox(module_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
Core.registerModule('utilities', function(sandbox) { | |
}); | |
return { | |
init: function() { | |
sandbox.listen('make-draggables', this.makeDraggables, true); | |
} | |
}; |
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 Core = (function($) { | |
var self; | |
// private methods: | |
var mathTest = function(method, arr) { | |
return Math[method].apply(Math, arr); | |
}; | |
return { |
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 Album < ActiveRecord::Base | |
has_many :assets | |
belongs_to :user | |
def self.formatted | |
all.map do |album| | |
{:id => album.id, | |
:name => album.name} | |
end | |
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
mouseMove: function(event) { | |
var x = event.pageX, | |
y = event.pageY; | |
if (self.isOutsideOfIcon(x, y) && self.isOutsideOfMenu(x, y)) { | |
// mouse has left bounds.. do something here.. | |
} | |
}, | |
isOutsideOfMenu: function(x, y) { |
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
<p> | |
<%= f.label :roles %><br /> | |
<% for ns in User::NOTIFICATION_SETTINGS %> | |
<%= check_box_tag "user[notification_settings][]", ns, @user.notification_settings.include?(ns) %> | |
<%=h notification_setting.humanize %><br /> | |
<% end %> | |
</p> |
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
Feature: Marketing Campaigns | |
Site administrators have created "campaigns" which influence the site's copy and appearance when visiting a special route which maps to a url with a campaign parameter. | |
Scenario Outline: Visiting pages without a campaign | |
Given I am on the <page> | |
Then I should see the <expected text> | |
And I should see any default images that exist for the "<page>" | |
Examples: | |
| page | expected text | |
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
Feature: In order to find posts that are relevant to what I am looking for | |
I want to be able to search for posts and filter the results | |
Background: | |
Given I am on the posts page | |
And the following posts exist: | |
| title | days old | price | distance | category | | |
| bike | .5 | 100 | 5 | Cars & Vehicles | | |
| sandwich | 6 | 5 | 10 | Stuff | | |
| computer | 25 | 1000 | 25 | Phones & Electronics | |