Skip to content

Instantly share code, notes, and snippets.

View patrick99e99's full-sized avatar

Patrick Collins patrick99e99

  • collinator studios
  • Saratoga Springs, Utah
View GitHub Profile
#import <Cocoa/Cocoa.h>
@interface Dog : NSObject {
NSString *name;
NSString *color;
NSString *hair;
NSString *size;
NSString *breed;
}
class Dog
def initialize(options = {})
@name = options[:name]
@color = options[:color]
@breed = options[:breed]
@hair = options[:hair]
@size = options[:size]
end
def description
var Core = (function($) {
return {
modules: {},
addModule: function(module_name, fn) {
// create new sandbox for module
var sandbox = new Sandbox(module_name);
Core.registerModule('utilities', function(sandbox) {
});
return {
init: function() {
sandbox.listen('make-draggables', this.makeDraggables, true);
}
};
var Core = (function($) {
var self;
// private methods:
var mathTest = function(method, arr) {
return Math[method].apply(Math, arr);
};
return {
@patrick99e99
patrick99e99 / album.rb
Created March 19, 2011 05:22
album model
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
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) {
<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>
@patrick99e99
patrick99e99 / campaigns.feature
Created September 21, 2011 19:35
campaigns test
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 |
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 |