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 LoggerKhan < Logger | |
def add(severity, message = nil, progname = nil) | |
return super unless severity == 'info' && "#{message}" =~ /some_tag/ | |
redis_logger.add(severity, message, progname) | |
end | |
private | |
def redis_logger | |
@redis_logger ||= Logger.new Rails.root.join('log', "redis_#{Rails.env}.log") |
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 ApprovedStep < ActiveRecord::Base | |
# you'd probably want to put your structured data here | |
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
class Login < ActiveRecord::Base | |
def self.average_seconds_to_login | |
average :time | |
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
<a data-role="collapsible" data-theme="f" data-iconpos="right" data-collapsed-icon="arrow-d" data-expanded-icon="arrow-u" class="inline-collapsible dark-border"> | |
<h3>Categories</h3> | |
<fieldset data-role="controlgroup"> | |
</fieldset> | |
</a> |
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 Instance < ActiveRecord::Base | |
has_many :reports | |
has_many :exams, primary_key: 'study_instance_uid', foreign_key: 'study_inst_uid', inverse_of: :instance | |
has_many :patients, through: :exams | |
before_save :set_reading_physician | |
def reading_physician | |
(set_reading_physician and save!) if reading_physician.nil? | |
read_attribute(:reading_physician) || '' |
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 ApplicationController < ActionController::Base | |
include UserAuthentication | |
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
/config/routes.rb | |
------------------------------------------------------------------------ | |
get '/products/update_productsubgroups', as: 'update_productsubgroups' | |
get '/update_productsubgroups' => 'products#update_productsubgroups' | |
resources :prodducts | |
/app/assets/javascript/products.coffee | |
------------------------------------------------------------------------ | |
$ -> | |
$(document).on 'change', '#productgroups_select', (evt) -> |
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 Group < ActiveRecord::Base | |
has_many :memberships | |
has_many :users, :through => :memberships | |
belongs_to :owner, class_name: 'User' | |
validates :owner, presence: true | |
validates :name, presence: true, length: { minimum: 6, maximum: 255 } | |
validates :description, length: { maximum: 255 }, allow_blank: true | |
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
<div class="row"> | |
<div class="wide-block contact-form" id="message_form"> | |
<!-- url: 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', method: :post--> | |
<div id="spinner" class="spinner" style="display:none;"> | |
<%= image_tag('ajax-loader.gif') %> | |
</div> | |
<%= form_for(@message ||= Alchemy::Message.new, :remote => true) do |form| %> | |
<%= form.hidden_field :contact_form_id, :value => element.id %> | |
<%#= form.hidden_field :oid, :value => '00D20000000DB0V'%> |
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
{ | |
:user_hash => Proc.new { |current_user| | |
OpenSSL::HMAC.hexdigest("sha256", "ENV['intercom_secret']", current_user.id.to_s) | |
} | |
} |