This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'thor' | |
| require 'dcell' | |
| require 'yaml' | |
| require 'command_line_reporter' | |
| class Filez < Thor | |
| include CommandLineReporter |
This file contains hidden or 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 'rubygems' | |
| require 'dcell' | |
| class TimeServer | |
| include Celluloid | |
| def time | |
| "The time is: #{Time.now}" | |
| end | |
| end |
This file contains hidden or 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 Block | |
| class Associated < Base | |
| def self.associate_many(field_name) | |
| lambda { | |
| field :"#{field_name}_uids", :type => Array, :default => [] | |
| define_method :"#{field_name}_uids=" do |arr| | |
| arr.shift if arr.first == '0' | |
| Rails.logger.warn "************************** TEST" | |
| super(arr.collect {|uid| uid.kind_of?(BSON::ObjectId) ? uid : BSON::ObjectId(uid)}) |
This file contains hidden or 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
| <a class="send" href="mailto:?body=<a href="http://www.ncr.com/documents/This_is_the_best_powerpoint.ppt">This_is_the_best_powerpoint.ppt</a>">Send</a> |
This file contains hidden or 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
| def self.is_breaking_news? object | |
| where("breaking_newsable_type = ? AND breaking_newsable_id = ?", object.class.to_s, object.id).first | |
| end |
This file contains hidden or 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
| object @prospect | |
| attributes :height, :weight | |
| code :image do |p| | |
| {:large => root_url.chop + p.image.url(:large), :thumb => root_url.chop + p.image.url(:thumb)} | |
| end | |
| code :primary_position do |p| | |
| p.primary_position.try(:name) | |
| end |
This file contains hidden or 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 Api::V1::ProspectsController < Api::V1::BaseController | |
| respond_to :json, :xml | |
| def show | |
| @prospect = Prospect.find(params[:id]) | |
| respond_with @prospect | |
| end | |
| end |
This file contains hidden or 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 Me | |
| end |
This file contains hidden or 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
| development: | |
| enable_star: 1 | |
| min_infix_len: 1 | |
| production: | |
| enable_star: 1 | |
| min_infix_len: 1 |
This file contains hidden or 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 Object | |
| def to_bool | |
| if pretentious | |
| if self | |
| return true | |
| else | |
| return false | |
| end | |
| else | |
| !!self |