Skip to content

Instantly share code, notes, and snippets.

View hprobotic's full-sized avatar
:dependabot:
On Break

John Pham hprobotic

:dependabot:
On Break
View GitHub Profile

UAT Connection test

MCP

1. Payload

{
    "header": {
        "msgId": "202307212MXIK1D9HSJM",
        "orgId": "HKREAP02",
        "timeStamp": "2023-07-21T12:15:49.585",
const fs = require('fs');
const xmlcrypto = require('xml-crypto');
const PAYLOAD = '<?xml version="1.0" encoding="UTF-8"?><oAuthToken xmlns="http://com.citi.citiconnect/services/types/oauthtoken/v1"><grantType>client_credentials</grantType><scope>/authenticationservices/v1</scope><sourceApplication>CCF</sourceApplication></oAuthToken>';
const SIGNATURE_PRIVATE_KEY_PATH = './citi/reap-encrypt-private.key';
const ENCRYPTION_PUB_CERT_PATH = './citi/reap-encrypt-public.pem';
const CITI_PUB_CERT_PATH = './citi/citigroupsoauat.dsig.citigroup.com.cer';
const signDocument = (payload, privSigKeyPath, elementToSign) => {

[FIX]: For Universal Clipboard copy/paste not working

I, like many people, have found that Universal Clipboard copy/paste stops working for no reason. I have a iPhone 12 Pro and an M1 MacBook Air.

All Handoff features work (e.g apps from phone showed up in dock) except copy/paste. I'd tried:

  • Turning BT and Wireless on and off again
  • Turning off/on Handoff on Mac/iPhone
  • Turning everything off on both devices, restarting, turning back on again
#!/bin/sh
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 << "EOF"
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.org/project/certifi/
@hprobotic
hprobotic / fix_pandas_pipenv_m1.md
Created December 16, 2022 02:06
Workaround on setup pandas on Apple silicon chip. Using pipenv

Initial Setup

MacOS Big Sur version 11.0.1
Python 3.9.2 installed using brew
pip 21.0.1
Pipenv to manage environment

Installing Pandas in Pipenv

Activate pipenv shell on the project folder (mine is called “pipenv-project”)

import pandas as pd
selected_columns = ["Amount", "Date", "Where"]
def find_diff_only(origin_df, target_df, identity="DBS"):
shared_with_origin = pd.merge_asof(
origin_df,
target_df,
on="Date",

Dev:

  1. Remove all pip packages: pip freeze | grep -v "^-e" | xargs pip uninstall -y

  2. Remove all brew packages: brew remove --force $(brew list --formula)

  1. Authentication

The Payment Dashboard API uses token to authenticate requests. You can get your token key by send login request.

import requests
import json

url = "https://s.api.formsquare.co/api/users/login/"

payload = json.dumps({
@hprobotic
hprobotic / payout.md
Last active November 15, 2021 01:21
query to get payout history

during Reap Pay admin payout, when Maker marks a transaction using any intermediary review status (rec_payout, Q12345, R12345, rec_complete), does this get stored in the DB even after such transaction is moved to Completed Transfers as either SUCCESS or REFUND? If so, which column is this in the DB?

The values of rec_payout, rec_complete meaning:

# NULL: unprocessed
# 1: Successfully
# 0: Failed
  1. Find all failed payout transactions: