Skip to content

Instantly share code, notes, and snippets.

View misterpig's full-sized avatar

Peter Zhu misterpig

  • Snowplow Analytics
  • Sydney, Australia
View GitHub Profile
@misterpig
misterpig / month_start_end.py
Last active April 23, 2019 04:04
Given two dates return a list of tuples of the first date of the month and last date of the month between the two dates
from datetime import date
from dateutil.relativedelta import *
def month_start_end(start_date, end_date, first_date='input', last_date='input'):
"""
For a given start date and end date this will generate a list of tuples containing the
date of the first day of the month and last day of the month for each month between the
given dates.
@misterpig
misterpig / README.md
Last active April 4, 2018 03:21
Salesforce Trigger ReadMe

Salesforce CRM SObject Triggers

Whitelisting

To enable the triggers to send payloads to the endpoints the IP must be whitelisted on Salesforce. In the Setup page head to Security Controls under Administer, then click on Remote Site Settings. Create a New Remote Site, enter the full endpoint URL.

Endpoint URL will be: http://<collector host>/com.snowplowanalytics.iglu/v1?schema=<iglu schema uri>

Examples:

@misterpig
misterpig / marketo_webhook.md
Last active March 19, 2018 00:28
Marketo Webhook Integration

Marketo Webhook Integration

Marketo allows the use of Webhooks to communicate with third party web services. Webhooks support the use of the GET or POST HTTP verbs to push or retrieve data from a specific URL.

1. Creating the webhook

  1. Go to Admin and click on Webhooks.
  2. Click New Webhook.
  3. Name and configure your webhook.
! 'flight.dat' contains data of the format
! 010 001
! 011 100
! 101 001 ...
! where "1" is a taken seat and "0" is empty
! adjacent seats can not cross over middle isle
PROGRAM SEATS
INTEGER, DIMENSION(38,6) :: seat