Skip to content

Instantly share code, notes, and snippets.

@Ryderpro
Ryderpro / postLead.js
Created September 26, 2018 01:42
Transform Squarespace leads in Google Sheets to TripleSeat form leads.
/**
* Post SquareSpace form entry to TripleSeat Form API.
*
* 0a. SquareSpace is connected to the SquareSpace form sheet.
* 0b. When a user makes a form entry in SquareSpace it is sent to a Google Sheet
*
* 1. This is a special function that looks for rows in this GoogleSheet that have not been "sent".
* 2. This function then sends a POST request with the form data to TripleSeat.
* 3. Then this function updates "TripleSeat Status" field to "Sent" in each row that was sent to TripleSeat.
* 4. Create a trigger in this project to run this function every 5 minutes, add yourself for script failure notifications
@asmallteapot
asmallteapot / Dictionary.Value+RangeReplaceableCollection.swift
Last active March 28, 2023 07:40
Swift: Append an element to an array in a dictionary value, creating the array/value if needed
import Foundation
extension Dictionary where Value: RangeReplaceableCollection {
public mutating func append(element: Value.Iterator.Element, toValueOfKey key: Key) -> Value? {
var value: Value = self[key] ?? Value()
value.append(element)
self[key] = value
return value
}
}