Skip to content

Instantly share code, notes, and snippets.

View infectious's full-sized avatar

Kepler EMEA infectious

View GitHub Profile
local ad = tonumber(ARGV[1])
local BL = 1
local weight = 0
-- bid price constant will be 50p : 500000 /1000 = 500
-- give up bid price constant will be 10p : 100000/1000 = 100
local give_up_bid = 100
-- Check if there is a weight
if tonumber(redis.call('zscore', 'ad:weights', ad)) == nil then
return nil
end
require 'ipaddr'
parameter :today do
2.day.ago.to_date
end
helper :logs_union do
((today - 30.days)..today).map do |date|
"""
SELECT ip
require 'ipaddr'
parameter :today do
2.day.ago.to_date
end
helper :new_ips do
NOP(:RDW).from(:"logs__#{today.ymd}").select_map { distinct(:ip) }
end
# Load 30 days of ip files into RDW
parameter :today do
2.day.ago.to_date
end
execute do
files = NOP(:ARC).join("appnexus/**/ips_*.txt.gz")
sources = files.reject do |file|