Skip to content

Instantly share code, notes, and snippets.

View atav32's full-sized avatar
🐝

Brian Zhang atav32

🐝
View GitHub Profile

Keybase proof

I hereby claim:

  • I am atav32 on github.
  • I am atav32 (https://keybase.io/atav32) on keybase.
  • I have a public key ASBki6eDRAf_eVHiR1PF_b_KoCOCQJzyeicxCOJa2_3_nAo

To claim this, I am signing this object:

@atav32
atav32 / post_hubspot_form.js
Created August 29, 2018 22:27
POST form data to HubSpot API
// API documentation, https://developers.hubspot.com/docs/methods/forms/submit_form
const convertToFormData = (data) => Object.entries(data).reduce((formData, entry) => {
const [key, value] = entry;
if (value !== null && typeof value === 'object') {
formData.append(key, JSON.stringify(value));
} else {
formData.append(key, value);
}
return formData;
@atav32
atav32 / convert_itermcolors.py
Last active February 18, 2024 01:38 — forked from MSylvia/convert_itermcolors.py
Convert .itermcolors file to html hex & rgb
#!/usr/bin/env python
#
# Convert .itermcolors files to hex colors for html
import sys
import xml.etree.ElementTree as ET
def rgb_to_hex(rgb):
return '#%02x%02x%02x' % rgb