Skip to content

Instantly share code, notes, and snippets.

View cqcn1991's full-sized avatar

ZK Zhao cqcn1991

  • Tongji University
  • 17:36 (UTC +08:00)
  • X @zk7hao
View GitHub Profile
@mlsaito
mlsaito / ssl_version.md
Last active July 21, 2023 08:09
Specify SSL version (TLS 1.2) on HTTParty - a Ruby client library

Implementation

Some vendors require you to call their API via TLS 1.2 and I don't see that much documentation on how to do this.

2 ways to make an HTTP request using HTTParty:

  1. Directly calling Class method.
# Notice the `ssl_version` option, to specify ssl version of the HTTP request
response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow', ssl_version: :TLSv1_2)
with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt