This file contains 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
[ | |
{ "event": "subscription", "account": "A001", "date": "2020-01-15" }, | |
{ "event": "subscription", "account": "B0001", "date": "2020-01-23" }, | |
{ "event": "subscription", "account": "C001", "date": "2020-01-25" }, | |
{ "event": "reactivation", "account": "B0001", "date": "2020-04-01" }, | |
{ "date": "2020-02-23", "account": "B0001", "event": "cancellation" }, | |
{ "date": "2020-04-03", "account": "B0001", "event": "cancellation" }, | |
{ "event": "reactivation", "account": "B0001", "date": "2020-05-12" }, | |
{ "date": "2020-06-18", "account": "B0001", "event": "cancellation" }, | |
{ "date": "2020-03-10", "account": "C001", "event": "cancellation" }, |
This file contains 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
Table: company | |
company_id company_name city | |
----------- ------------------ ---------- | |
1 ABC Ltd Stanford | |
2 Alpha Inc San Francisco | |
3 Magic Corporation New York | |
4 Umbrella Corp Boston | |
5 OCP Detroit | |
Table: employee |
This file contains 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
❯ curl -v --head https://rubygems.org | |
* Rebuilt URL to: https://rubygems.org/ | |
* Trying 151.101.194.132... | |
* TCP_NODELAY set | |
* Connected to rubygems.org (151.101.194.132) port 443 (#0) | |
* ALPN, offering h2 | |
* ALPN, offering http/1.1 | |
* successfully set certificate verify locations: | |
* CAfile: /etc/ssl/certs/ca-certificates.crt | |
CApath: /etc/ssl/certs |
This file contains 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
❯ curl -v --head https://api.rubygems.org | |
* Rebuilt URL to: https://api.rubygems.org/ | |
* Trying 151.101.130.132... | |
* TCP_NODELAY set | |
* Connected to api.rubygems.org (151.101.130.132) port 443 (#0) | |
* ALPN, offering h2 | |
* ALPN, offering http/1.1 | |
* successfully set certificate verify locations: | |
* CAfile: /etc/ssl/certs/ca-certificates.crt | |
CApath: /etc/ssl/certs |
This file contains 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 flatten(List): | |
result = [] | |
for i in List: | |
if type(i) is int: | |
result.append(i) # if its an int append to result list | |
else: | |
if type(i) is list: #If it's not a list, skip | |
result += flatten(i) | |
return result |