Skip to content

Instantly share code, notes, and snippets.

@robertainslie
robertainslie / submit-to-hubspot-forms-api-with-javascript.md
Last active June 20, 2025 08:31
Submitting to the HubSpot Forms API with JavaScript

Overview

This tutorial will walk you through how to submit to the HubSpot Forms API using Javascript. Check out the documentation for submitting to the Forms API.

  • It will use vanilla JS (i.e. no libraries or frameworks) and will provide example code.
  • It will assume that you are familiar with HubSpot, HubSpot Forms, and that the HubSpot Tracking Code is on the page.

A note on the HubSpot cookie: hubspotutk

The HubSpot tracking code is a javascript snippet that is placed on websites. It anonymously collects website visit data, similar to Google Analytics. This anonymous visit data can be associated to HubSpot Contact record through a few means, including sending a usertoken value when submitting data to the Forms API. The tracking code generates a cookie containing a unique usertoken called hubspotutk. The value of hubspotutk will be submitted in our form submission as hutk. HubSpot uses this cookie value to connect visito

@duanescarlett
duanescarlett / index.js
Last active April 10, 2022 00:37
Send Ether to another wallet
ethers = require('ethers')
require('dotenv').config()
async function main () {
// Connect to an EVM network
const provider = new ethers.providers.JsonRpcProvider(`https://polygon-mainnet.g.alchemy.com/v2/${process.env.RPC_KEY}`)
// Get the gas price
const gasPrice = provider.getGasPrice()
// Create a wallet object from private key
const wallet = new ethers.Wallet(`${process.env.PRIVATE_KEY}`)
@finxter
finxter / structArray2.sol
Created December 28, 2021 08:28 — forked from yassesh/structArray2.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
contract SavingsAccount {
struct Member{
uint id;
string name;
uint balance;
}
mapping (uint => Member) public members;
event savingsEvent(uint indexed _memberId);
@thpham
thpham / leadership_principles_questions.md
Created October 12, 2021 18:04
Interview questions

Are Right, A Lot

  1. Tell me about a decision for which data and analysis weren’t sufficient to provide the right course and you had to rely on your judgment and instincts. Give me two to three examples. They don’t have to be big strategic decisions – could be big or small.
  2. Tell me about a time you made a difficult decision and how you knew it was the right solution (probe on how they evaluated the options, if they received input, what data they reviewed, etc.)
  3. Give me an example of when you have to make an important decision in the absence of good data because there just wasn’t any. What was the situation and how did you arrive at your decision? Did the decision turn out to be the correct one? Why or why not?
  4. Tell me about a time when you made a bad decision and the learning from the experience enabled you to make a good decision later. What did you learn that you were able to apply?
  5. Tell me about a time when you have been faced with a challenge where the best way forward or strategy
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
const Web3 = require('web3');
class TransactionChecker {
web3;
web3ws;
account;
subscription;
constructor(projectId, account) {
this.web3ws = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws/v3/' + projectId));
'use strict';
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
storage
.getBuckets()
.then((results) => {
const buckets = results[0];
@1Marc
1Marc / digging-into-node.md
Last active February 28, 2025 12:39
Digging Into Node.js Setup

Setup

Make sure you have Node 11+ installed.

Type node -v in your command line to check your version.

Install sqlite3: npm install sqlite3

For Windows

@Pelirrojo
Pelirrojo / README.md
Created October 16, 2018 10:44
NodeJS Local example with DynamoDB/Docker

NodeJS Local Examples with DynamoDB/Docker

Some samples to test DynamoDB locally through Docker

  # Download & Run LocalStack
  $ docker pull localstack/localstack:latest
 $ docker run -it -p 4567-4578:4567-4578 -p 8080:8080 localstack/localstack
@huogerac
huogerac / HomeView.vue
Created June 7, 2018 03:34
Push Notifications
<template>
<div>
<!-- componente que encapsula o PUSH NOTIFICATION -->
<push-notification
ref="pushNotification"
:currentToken="userToken"
@update-token="onUpdateToken"
@new-message="onNewMessage" />