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.get_product(sku, params = {}) | |
| params.reverse_merge!({ | |
| 'advertiser-ids' => 'joined', | |
| 'advertiser-sku' => sku, | |
| 'website-id' => COMMISSION_JUNCTION_PID | |
| }) | |
| Nokogiri.XML(get('https://product-search.api.cj.com/v2/product-search?', params)) | |
| 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 redirect_for_geo_partner | |
| return unless request.env['GEOIP_COUNTRY_CODE'] && geo_partner = Partner.find_by_country(request.env['GEOIP_COUNTRY_CODE']) | |
| desired_path = request.path | |
| if logged_in? | |
| if on_partner_site? | |
| if current_user.referable.nil? || (current_user.referable && !current_user.referable.kind_of?(Partner)) | |
| # This user has no partner but is on a partner site. Kick them back to app. | |
| redirect_to "http://#{HOST}" + desired_path |
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
| # Apache sets an environment variable called USER_GEO on every request | |
| # with a country code for where the IP is from | |
| def redirect_for_geo_partners | |
| return unless geo_partner = Partner.find_by_country(env['USER_GEO']) | |
| # Store the request path | |
| desired_path = request.path | |
| if logged_in? | |
| if on_partner_site? |
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 blah | |
| begin | |
| Timeout.timeout(1) do | |
| sleep(2) | |
| end | |
| rescue Exception => e | |
| return {:foo => :bar} | |
| 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
| convert: function(amount, from, to) { | |
| $.get("/currency_conversion/" + amount + "/from/" + from + "/to/" + to, function(response) { | |
| parseFloat(response); | |
| }); | |
| } |
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.send_update_to(user, date = ActivityUpdateMailer.current_or_next_update) | |
| # blah blah | |
| 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
| <style type="text/css"> | |
| body { | |
| background: black; | |
| } | |
| </style> |
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.button, button.button { | |
| font-family: "Lucida Grande", Tahoma, Arial, sans-serif; | |
| float: left; | |
| margin: 0 7px 0 0; | |
| padding: 0px; | |
| background: transparent; | |
| text-decoration: none; | |
| border: none; | |
| display: block; |
NewerOlder