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
<html> | |
<div id='my-app-id'></div> | |
<script type="text/javascript"> | |
var MyApp = require("my_app"); | |
$(function(){ new MyApp({ el: $("#my-app-id") }) }); | |
</script> |
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 CountUpCash | |
COST_OF_TWENTY_FIVE_DOLLAR_GIFT_CARDS = 50000 | |
COST_OF_TEN_DOLLAR_GIFT_CARDS = 20000 | |
DEFAULT_QUERY = { :points.gte => 20000, :banned.in => [ false, nil ] } | |
attr_accessor :query, :total_number_of_twenty_five_dollar_gift_cards, :total_number_of_ten_dollar_gift_cards | |
def initialize(query = {}) | |
@query = DEFAULT_QUERY.merge(query) |
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
select * from versions, (select max(versions.id) as id from versions left outer join localizations on localizations.id = versions.localization_id where localizations.id is null group by versions.localization_id) as x where versions.id = x.id and versions.created_at > to_date('2012-03-18', 'yyyy-mm-dd') and versions.number != 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
member_ids = Member.where(:lab => true).only(:_id).map(&:id) | |
after = Date.parse('10/4/2013').to_time.at_beginning_of_day | |
before = Award.where(:created_at.gt => after, :brand_id => nil, :points => Game.int_var('challenge_points_for_each_awardable_view'), :reason => 'Someone checked out your Web Share').asc(:created_at).last.created_at | |
def complete_award(challenge) | |
challenge.award_and_complete if challenge.unique_views_count >= WebShare.min_challenge_view_count_for_completion | |
end | |
def view_awards(challenge) | |
[challenge.unique_views_count, Challenge.max_awardable_views].min.times{ challenge.award_for_event(:visitor_unique_view) } |
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 'uri' | |
require 'net/http' | |
require 'net/https' | |
require 'ruby-progressbar' | |
require 'set' | |
def add_bad_ip(ip) | |
File.open('ips.txt', 'a') {|f| f.puts ip } | |
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
def brand_actions_summary | |
targeted_brand_actions = targetable_actions | |
new_brand_actions_by_brand_id = targeted_brand_actions.group_by(&:brand_id) | |
active_participations = participations.where({ | |
:stage.nin => Participation::Base::NON_ACTIVE_STAGES + Participation::LEGACY_NON_ACTIVE_STAGES | |
}) | |
active_participations_by_brand_id = {} | |
expiring_brand_actions_by_brand_id = {} |
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 'ruby-progressbar' | |
module TagTestAccounts | |
REGEX = /@tfbnw\.net$/ | |
def self.members | |
Member.where(:email => REGEX) | |
end | |
def self.run! |
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
out.log |
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
CashstarFulfillment.all.each do |cf| | |
cf.set(:prize_win_id, cf.win_id) | |
end | |
Win.all.each do |win| | |
win.set(:_type, 'PrizeWin') | |
end | |
CashstarFulfillment.all.each do |cf| | |
cf.unset(:win_id) |
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 PickCrowdWinners | |
attr_accessor :crowd_drawing, :ids | |
def initialize(crowd_drawing) | |
@crowd_drawing = crowd_drawing | |
end | |
def ids | |
@ids ||= begin | |
ids = Set.new |