Skip to content

Instantly share code, notes, and snippets.

@nchudleigh
nchudleigh / speedtest.py
Created July 18, 2024 18:40
Speed test of openai models
import time
import os
from openai import OpenAI
import pandas as pd
import matplotlib.pyplot as plt
from dotenv import load_dotenv
# Install required packages
# pip install openai matplotlib pandas python-dotenv
# Create a .env file in the same directory as this script
@nchudleigh
nchudleigh / events.json
Last active July 11, 2018 02:25
Events in Toronto
[
{
"description": "Sale Dates and Times:\n\nPublic Onsale : Thu, 8 Feb 2018 at 10:00 AM\n\nPresale : Tue, 6 Feb 2018 at 10:00 AM",
"name": "Toronto Blue Jays vs. Houston Astros",
"place": {
"name": "Rogers Centre",
"location": {
"city": "Toronto",
"country": "Canada",
"latitude": 43.641218085414,
@nchudleigh
nchudleigh / food.json
Last active January 28, 2024 13:05
food
{
"food": [
{"name": "Pizza", "icon": "🍕"},
{"name": "Hotdog", "icon": "🌭"},
{"name": "Burger", "icon": "🍔"},
{"name": "Bacon", "icon": "🥓"},
{"name": "Pancakes", "icon": "🥞"},
{"name": "Taco", "icon": "🌮"},
{"name": "Fries", "icon": "🍟"}
]
@nchudleigh
nchudleigh / growsumojs-loader.js
Created November 2, 2016 17:32
GrowSumoJS Loader
<script type='text/javascript'>!function(){var t=document.createElement("script");t.src="https://snippet.growsumo.com/growsumo.min.js",t.type="text/javascript",t.async="true",t.onload=t.onreadystatechange=function(){var t=this.readyState;if(!t||"complete"==t||"loaded"==t)try{growsumo._initialize("<REPLACE WITH YOUR PUBLIC KEY>"),"function"==typeof growsumoInit&&growsumoInit()}catch(e){}};var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}();</script>
<script>
// This function is called when GrowSumoJS is loaded
function growsumoInit(){
console.log('GrowSumoJS loaded', growsumo);
}
</script>
<script type='text/javascript'>!function(){var t=document.createElement("script");t.src="https://snippet.growsumo.com/growsumo.min.js",t.type="text/javascript",t.async="true",t.onload=t.onreadystatechange=function(){var t=this.readyState;if(!t||"complete"==t||"loaded"==t)try{growsumo._initialize("pk_d9FOdhhfrKGLy9YCGYIVQJVqv6PdNIxf"),"function"==typeof growsumoInit&&growsumoInit()}catch(e){}};var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}();</script>
<script>
function growsumoInit(){
if (typeof growsumo != 'undefined') {
growsumo.data.email = '[email protected]';
growsumo.data.customer_key = 123;
console.dir(growsumo);
growsumo.createSignup();
}
};
@nchudleigh
nchudleigh / capture_signup.js
Last active August 22, 2016 15:11
Capturing Signups with the GrowSumo Javascript Snippet
function yourSignupFunction(customerEmail, customerName, customerKey) {
/*
customer_key (string, required)
used to uniquely identify your customer
*/
growsumo.data.customer_key = customerKey;
/*
email (string, required)
email of the customer signing up
*/