Skip to content

Instantly share code, notes, and snippets.

View hprobotic's full-sized avatar
🌴
On vacation

John Pham hprobotic

🌴
On vacation
View GitHub Profile
@hprobotic
hprobotic / clean_my_mac_x_guide.md
Last active November 5, 2023 04:19
CleanMyMac X tutorial
  • 1. Install the trial from https://macpaw.com/cleanmymac
  • 2. Open CleanMyMac then click Action then Authenticate
  • 3. Install the CleanMyMac installer from here, click replace 
  • 4. I didn’t try to open the app. 
  • 5. Run: sudo xattr -r -d com.apple.quarantine /Applications/CleanMyMac\ X.app
  • 6. Run codesign -f -s – –deep /Applications/CleanMyMac\ X.app/ (Check note)
  • 7. Open CleanMyMac

Notes:

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({