Skip to content

Instantly share code, notes, and snippets.

Avatar

Bogdan Gusiev bogdan

View GitHub Profile
View query_methods.rb
def build_select(arel, selects)
unless selects.empty?
@implicit_readonly = false
arel.project(*selects)
else
arel.project(@klass.arel_table[Arel.star])
end
end
View index.html
<html>
<head></head>
<body>
<div id='place-for-curebit-iframe'>
<script>
SegmentIo.curebit_register_affiliate({campaign_tags: ['something'], responsive: true});
</script>
</div>
View datagrid_csv.rb
class TimeEntryReportsController < ApplicationController
def index
@time_entry_report = TimeEntryReport.new(params[:time_entry_report])
respond_to do |f|
f.html do
@assets = @time_entry_report.assets.page(params[:page])
end
f.csv do
send_data @time_entry_report.to_csv, type: "text/csv", disposition: 'inline'
View offers_controller.rb
if params[:sample_from_campaign_hash]
Campaign::find_by_unique_hash(params[:sample_from_campaign_hash]).sample_offer
View test.html
<html>
<head>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Begin Curebit integration code -->
<script>
//<![CDATA[
View int_success.html
<html>
<head>
</head>
<body>
<!-- Begin Curebit integration code -->
<script type="text/javascript">
//<![CDATA[
(function(){function load_js(){var s=document.createElement('script');s.type='text/javascript';s.async=true; s.src='//d2jjzw81hqbuqv.cloudfront.net/assets/api/all-0.6.js'; var x=document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x)} if(window.attachEvent)window.attachEvent('onload',load_js);else window.addEventListener('load',load_js,false)})();
View html.html
#<html>
#<head>
#</head>
#<body>
#<p>
#Hello <strong>World</strong>
#</p>
#</body>
#</html>
View liquid_template.html.haml
!!!
%html
%head
= all_layouts_head
= javascript_include_tag(:bootstrap_offers_show)
%body{class: current_view_body_class}
- if @campaign.is_a?(DoubleSidedDealCampaign) && !inline_integration? && @view_setup.try(:name) == "offers_show"
= render(layout: "layouts/actions/overlay") { yield }
- else
= yield
View sidekiq.yml
---
:verbose: false
<% if ENV["WORKER"] == "mailer" %>
:concurrency: 5
:queues:
<% views = YAML.load_file(File.join(".", "config", "view_settings.yml")) %>
<% views.select { |k, v| v[:email_view] }.keys.each do |queue| %>
- [<%= queue %>, 10]
<% end %>
- [email_blast, 1]
View view_mailer.rb
def self.email_recipient(view, translator)
case view.to_sym
when :notifier_offers_email
translator.person
when :notifier_offers_share_via_email, :notifier_offers_share_via_email_reminder
translator.person
when :notifier_rewards_origins_referrer_confirmation
translator.person
when :notifier_rewards_origins_referred_confirmation
translator.person