Skip to content

Instantly share code, notes, and snippets.

@nucliweb
nucliweb / Install-OpenCV-Mac-M1.md
Last active November 14, 2024 00:48
OpenCV C++ Mac M1 Installation Steps
@ih2502mk
ih2502mk / list.md
Last active November 19, 2024 13:02
Quantopian Lectures Saved
@cdosborn
cdosborn / verify_sns.py
Last active October 5, 2023 22:31 — forked from amertkara/aws_utils.py
Amazon SNS Notification Verification with Python, M2Crypto. When the SNS pushes a notification, a receiver should verify the origin/integrity of the push notification (AWS) using the signature and certificate provided in the notification data. The function `verify_sns_notification` below takes the request object and verifies the origin/integrity…
from flask import current_app
from cryptography import x509
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.asymmetric import padding
import base64
from urllib.parse import urlparse
import logging
@jimmysitu
jimmysitu / morningstar.com API.md
Last active November 5, 2023 09:54
morningstar.com API

morningstar.com API

  • Get key ratio, return csv format file
http://financials.morningstar.com/ajax/exportKR2CSV.html?t=<market>:<stock>

Market

  • XHKG: Hong Kong Stock Exchange
  • XASE: American Stock Exchange
  • XNAS: Nasdaq Stock Exchange >* XNYS: New York Stock Exchange
@martinthenext
martinthenext / isin_from_cusip.py
Created April 28, 2016 14:58
Get ISIN from CUSIP in Python
def get_isin_from_cusip(cusip_str, country_code):
"""
>>> get_isin_from_cusip('037833100', 'US')
'US0378331005'
"""
isin_to_digest = country_code + cusip_str.upper()
get_numerical_code = lambda c: str(ord(c) - 55)
encode_letters = lambda c: c if c.isdigit() else get_numerical_code(c)
to_digest = ''.join(map(encode_letters, isin_to_digest))
@alghanmi
alghanmi / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}