Skip to content

Instantly share code, notes, and snippets.

View molinto's full-sized avatar
🎯
Focusing

Sharry Stowell molinto

🎯
Focusing
  • Molinto
  • United Kingdom
View GitHub Profile
@molinto
molinto / ChartCreationTest.ts
Created October 13, 2023 15:52
Azure Function using ChartJs - generate on the fly & toBase64Image
// Author: Sharry Stowell
// Date: 13/10/2023
import {
app,
HttpRequest,
HttpResponseInit,
InvocationContext,
} from "@azure/functions";
@molinto
molinto / SquareSpaceProductToKlaviyoEvents.js
Last active October 21, 2020 15:00
Squarespace to Klaviyo - View Product & Add to Cart events (with variants)
// I'M USING THE 'BRINE' THEME & GBP CURRENCY
// REMEMBER TO PLACE THE FOLLOWING IN THE HEADER (https://x.squarespace.com/config/settings/advanced/code-injection)
/////////////////////////////////////////////////////////////////////////////////////
<script type="application/javascript" async src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY_HERE"></script>
<script>var _learnq = _learnq || [];</script>
// FOLLOWING PART IS PLACED IN A <CODE> BLOCK IN THE ADDITIONAL-INFO SECTION ON PRODUCT EDIT PAGE
///////////////////////////////////////////////////////////////////////////////////////
app.get('/user/status/:id', User.status);
userStatus - determines the status of the user:
blocked,
over quota,
logged on,
@molinto
molinto / activeCampaignAPI3.txt
Created April 19, 2016 11:21
Active Campaign API v3
API v3 known endpoints:
[GET with SESSION]
https://SUBDOMAIN.api-us1.com/api/3/tags
https://SUBDOMAIN.api-us1.com/api/3/tags/1
https://SUBDOMAIN.api-us1.com/api/3/contacts
https://SUBDOMAIN.api-us1.com/api/3/contacts/7
https://SUBDOMAIN.api-us1.com/api/3/deals
@molinto
molinto / intercomOnAc.js
Last active February 22, 2016 13:54
Active Campaign Intercom JS
%HEADERNAV%
%PAGECONTENT%
%FOOTER%
<script>
var sitename = "%SITEURL%";
sitename = sitename.replace(".activehosted.com", "").replace("https://", "");
sitename = sitename.replace(".primaryDomain.com", "").replace("http://", "");
var email = "%USEREMAIL%";
@molinto
molinto / x-delayed-type.js
Last active May 27, 2016 11:42
CloudAMQP delayed msg example
/*
Example from:
https://www.cloudamqp.com/blog/2016-02-05-rabbitmq_delayed_message_exchange_plugin_with_node_js.html
BY LOVISA JOHANSSON POSTED 2016-02-05
*/
var amqp = require('amqplib/callback_api');
var amqpConn = null;
@molinto
molinto / docker-compose.yml
Created September 17, 2015 12:38
Microservices nodejs
## from example: https://github.com/ibmjstart/Microservices/tree/split ##
productapi:
build: ./services/productAPI
ports:
- "49760:8080"
cartapi:
build: ./services/cartAPI
ports:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quaderno.js for One-off Charges on Stripe</title>
<!-- The required libs -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script type="text/javascript" src="https://js.quaderno.io/v2/"></script>
# NODEJS express on port 3001
upstream nodeapp {
server IPADDRESS:3001;
}
# NGINX Server Instance
server {
listen 80;
server_name localhost;
root /home/path/to/website;
@molinto
molinto / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console