Skip to content

Instantly share code, notes, and snippets.

View jstacoder's full-sized avatar
:octocat:
working

Kyle J. Roux jstacoder

:octocat:
working
View GitHub Profile
@jstacoder
jstacoder / validate.py
Last active May 16, 2019 13:48
VALIDATE QUICKBOOKS SIGNATURE HEADER FOR WEBHOOK PYTHON
import base64
import hmac
import hashlib
def validate_signature_header(verifier_token, request_body, signature):
# per quickbooks documentation
# 1st step:
# hash the notification payload (request_body) with HMAC_SHA256_ALGORITHM
# using <verifier token> as the key
hmac_hex_digest = hmac.new(
@jstacoder
jstacoder / EventStore.tsx
Last active June 12, 2023 11:53
useEventStore hook for calendar app
import React, {
createContext,
useReducer,
useContext,
} from 'react'
type Event = {
title: string;
start: string | Date;
end?: string | Date;